Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mysql Ô¶³Ì ip·ÃÎÊ


ĬÈÏÇé¿öÏÂLinuxÄÚµÄmysqlÊý¾Ý¿âmysql£¬user±íÄÚµÄÓû§È¨ÏÞÖ»ÊǶÔlocalhost¼´±¾»ú²ÅÄܵǽ¡£ÐèÒª¸ü¸ÄȨÏÞ£º
Èçϵķ½Ê½È·ÈÏ£º
root#mysql -h localhost-u mysql -p 
Enter password:    ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.0.20a-debug
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql;   (´ËDB´æ·ÅMySQLµÄ¸÷ÖÖÅäÖÃÐÅÏ¢)
Database changed
mysql> select host,user from user; (²é¿´Óû§µÄȨÏÞÇé¿ö)
+-------------+-------+
| host            | user    |
+-------------+-------+
| localhost      |           |
| localhost      | root   |
| localhost      |           |
| localhost      | mysql |
+-------------+-------+
6 rows in set (0.02 sec)
ÓÉ´Ë¿ÉÒÔ¿´³ö£¬Ö»ÄÜÒÔlocalhostµÄÖ÷»ú·½Ê½·ÃÎÊ¡£
½â¾ö·½·¨£º
mysql> Grant all privileges on *.* to 'root'@'%' identified by ‘password’with grant option;
(%±íʾÊÇËùÓеÄÍⲿ»úÆ÷£¬Èç¹ûÖ¸¶¨Ä³Ò»Ì¨»ú£¬¾Í½«%¸ÄΪÏàÓ¦µÄ»úÆ÷Ãû£»‘root’ÔòÊÇָҪʹÓõÄÓû§Ãû£¬)
mysql> flush privileges;  (ÔËÐÐΪ¾ä²ÅÉúЧ£¬»òÕßÖØÆôMySQL)
Query OK, 0 rows affected (0.03 sec)
mysql> select host,user from user; (Ôٴβ鿴Óû§µÄȨÏÞÇé¿ö)
+-------------+-------+
| host            | user    |
+-------------+-------+
| £¥                 | mysql |
| £¥                 | root   |
| localhost  


Ïà¹ØÎĵµ£º

ÐÞ¸ÄubuntuÏÂmysqlĬÈϱàÂë

±à¼­/etc/mysql/my.cnfÎļþ£¬Ï൱ÓÚwindowsÖеÄmy.ini£º
ÕÒµ½[client]
Ìí¼Ó£º
default-character-set = utf8 // ĬÈÏ×Ö·û¼¯Îªutf8
ÕÒµ½[mysqld]
Ìí¼Ó:
default-character-set = utf8 //ĬÈÏ×Ö·û¼¯Îªutf8
init_connect = 'SET NAMES utf8' //É趨Á¬½ÓmysqlÊý¾Ý¿âʱʹÓÃutf8±àÂ룬ÒÔÈÃmysqlÊý¾Ý¿âΪutf8ÔËÐÐ
Ð޸ĺú ......

SQL ServerÀィMysqlÁ´½Ó·þÎñÆ÷µÄͼ½â

ÔÚSQL ServerÀィMysqlºÍOracleÊý¾Ý¿âÁ´½Ó»¹ÊDZȽÏÈÝÒ׵ģºÎÒÃÇÏÈÔÚ·þÎñÆ÷ÉÏ°²×°MysqlºÍOracleÊý¾Ý¿âÏà¹ØµÄODBCÇý¶¯³ÌÐò£¬ÔÚ[¹ÜÀí¹¤¾ß]->[Êý¾ÝÔ´(ODBC)]       ÉèÖÃϵͳDSN£¬ÈçÏÂͼ:     
 
ÉèÖúÃÁËÒÔºó£¬ÎÒÃÇ¿ÉÒÔÓÃSQL Server×Ô´øµÄµ¼³öºÍµ¼È빤¾ßÀ´Êµ ......

mysql ʱ¼äµÄ´¦Àí

TO_DAYS(date)   //¸ø¶¨Ò»¸öÈÕÆÚ£¬·µ»Ø´Ó0Ä꿪ʼµÄÌìÊý¡£
from_DAYS(N)   //¸ø¶¨Ò»¸öÌìÊý£¬·µ»ØÒ»¸öÈÕÆÚ¡£
È磺
select TO_DAYS('1997-10-7')   //·µ»Ø729669
select from_DAYS(729669)    //·µ»Ø1997-10-7
UNIX_TIMESTAMP(), UNIX_TIMESTAMP(date)
ÈôÎÞ²ÎÊýµ÷Óã¬Ôò·µ ......

Linux»·¾³ÏÂMySQLµÄ°²×°

1¡¢ÏÂÔØMySQLÃâ°²×°°æ/¶þ½øÖÆ°æÈí¼þ£¨²»ÓñàÒ룩
Îļþ¸ñʽ£ºMYSQL-VERSION-OS.tar.gz
 
2¡¢´´½¨MySQL×飬½¨Á¢MySQLÓû§²¢¼ÓÈëµ½mysql×éÖÐ
£¨²»Í¬°æ±¾µÄUnixÖУ¬groupaddºÍuseraddµÄÓï·¨¿ÉÄÜ»áÉÔÓв»Í¬¡££©
#groupadd mysql
#useradd -g mysql mysql
 
3¡¢½øÈëĿ¼/usr/local£¬½âѹËõÃâ°²×°°æ£¬²¢ÔÚ ......

mysql Êý¾Ý¿âжÔز»ÍêÈ«£¬ÅäÖóö´í½â¾ö°ì·¨

The security settings could not be applied to the database because the connection has failed with the following error.
Error Nr. 2003
Can't connect to MySQL server on 'localhost' (10061)
If a personal firewall is running on your machine, please make sure you have opened the TCP port 3306 for conn ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ