Mysql Error #2002: Can't connect to local
ÔÚSentOS 5ÖУº
>>yum install mysql
°²×°Íê±Ïºó£¬
>>mysql
error:Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'(2)";
½ñÌì·þÎñÆ÷Óöµ½ÁËÒ»¸öºÜÊìϤµÄÎÊÌâ
ÊäÈë
#mysql -u root -p
ERROR 2002 (HY000):Can't connect to local MySQL server
Ëæ¼´ÉÏÍøÕÒÑ°´ð°¸,µ«ÊǶ¼²»ÊÇ£¬ÎÊÌâÊÇÎÒ°²×°µÄmysqlÊÇÓÐÎÊÌâµÄ£¬Ó¦¸ÃÊÇ£º
>>yum install mysql-server
ÕâÑù¾ÍûÎÊÌâÁË£¡
¸ù¾Ý´ó¼ÒÌṩµÄ·½·¨ÎÒÖðÒ»³¢ÊÔ
·½°¸1.
1.#ps -A|grep mysql
ÏÔʾÀàËÆ£º
1829 ? 00:00:00 mysqld_safe
1876 ? 00:00:31 mysqld
2.#kill -9 1829
3.#kill -9 1876
4.#/etc/init.d/mysql restart
5.#mysql -u root -p
ËûµÄÂé·³½â¾öÁË,ÎҵĻ¹Ã»½â¾ö!
¼ÌÐøÕÒ
·½°¸2
ÏȲ鿴 /etc/rc.d/init.d/mysqld status ¿´¿´m y s q l ÊÇ·ñÒѾÆô¶¯.
ÁíÍâ¿´¿´ÊDz»ÊÇȨÏÞÎÊÌâ.
------------------------------------------------------------------------------------
[root@localhost beinan]#chown -R mysql:mysql /var/lib/mysql
[root@localhost beinan]# /etc/init.d/mysqld start
Æô¶¯ MySQL£º [ È·¶¨ ]
[root@localhost lib]# mysqladmin -uroot password '123456'
[root@localhost lib]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.1.11
Type 'help;' or '\h' for help. Type '\c' to clear the buffe
ËûµÄÒ²½â¾öÁË,ÎÒµÄÂé·³»¹ÔÚ¼ÌÐø,ÒÀÈ»¼ÌÐøÑ°ÕÒ
·½°¸3
ÎÊÌâ½â¾öÁË£¬¾¹È»ÊÇmax_connections=1000 Ëû˵̫¶àÁË£¬È»ºó¸Ä³É500Ҳ˵¶à£¬ÎÞÄÎɾ֮ÎÊÌâ½â¾öÁË¡£
»¹ÊDz»ÐÐ
·½°¸4
/var/lib/mysql ËùÓÐÎļþȨÏÞ ¸Ä³Émysql.mysql
²»Ðв»ÐÐ
·½°¸5
ÕªÒª£º½â¾ö²»ÄÜͨ¹ýmysql .sockÁ¬½ÓMySQLÎÊÌâ Õâ¸öÎÊÌâÖ÷ÒªÌáʾÊÇ£¬²»ÄÜͨ¹ý '/tmp/mysql .sock'Á¬µ½·þÎñÆ÷£¬¶øphp±ê×¼ÅäÖÃÕýÊÇÓùý'/tmp/mysql .
Ïà¹ØÎĵµ£º
Êý¾Ýͬ²½ÎÊÌâÖÕÓÚ½â¾ö£º
תÌû£ºA·þÎñÆ÷£º host 192.168.1.101 port 3306 B·þÎñÆ÷£º host 192.168.1.102 port 3306 1,ÊÚȨÓû§£º A·þÎñÆ÷ mysql>grant replication slave,file on *.* to 'repl9'@'192.168.1.102' identified by '1234569'; Query OK, 0 rows affected (0.01 sec) mysql> flush privileges; Qu ......
sqlserverÖУº
1 /*
2 1 * Description:¶ÔÊý¾Ý±í½øÐÐÐÐÁÐת»»
3 2 * Author:llf
4 3 * µ÷ÓÃ˵Ã÷£ºexec SP_RowChangeCol 'ѧÉú³É¼¨±í','ÐÕÃû','¿Î³Ì','·ÖÊý','desc',0,0,'where Ä꼶=''Ò»Ä꼶'''
& ......
ÍüÁËOracleµÄsysÓû§ºÍMySQLµÄrootÓû§ÃÜÂ룬½â¾ö·½·¨
2007Äê03ÔÂ16ÈÕ ÐÇÆÚÎå 09:44
×÷Õߣºhexiong¡¡
°æȨÉùÃ÷£º¿ÉÒÔÈÎÒâתÔØ£¬×ªÔØʱÇëÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂÔʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷¡£
http://hi.baidu.com/hexiong/blog/item/b4acd72a85272d2cd42af1b1.html
¾³£Åöµ½ÓÐÈËÔÚÂÛ̳ÉÏÎÊÕâ¸öÎÊÌ⣬¸É´àÔÚÕâÀï×ܽáÒ ......
×î½üÐèҪʹÓÃMySQL£¬Ö»ºÃ¸Ï½ôѧϰһÏ¡£ÄÄÀïÖªµÀµÚÒ»²½¾Í¿¨×¡ÁË¡£×°ÁËÒ»¸ö¿Í»§¶Ë£¬Á¬²»ÉÏ£¬±¨1045µÄ´íÎó¡£
´ÓÍøÉÏÕÒÁËһϣ¬Èý²½¾ÍºÃ¡£
INSERT INTO `user` VALUES ('%','root','*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',' ......
ÔÎÄת×Ôhttp://www.mysqlsystems.com/2009/04/mysql_sanbox.html
һȺº£ëàÔÚÊôÓÚ×Ô¼ºµÄº£Ì²ÉÏ×ÔÓɵÄÍæË££¬¾¡¹ÜÖ»ÊÇÒ»¸ö·½ºÐµÄ´óС£¬µ«ÊÇÉ豸һÑù
µÄÆëÈ«£¬Í¬Ñù¿ÉÒÔÍæµÄºÜ¿ªÐÄ£¬Õâ¾ÍÊÇÎÒ½ñÌìҪ˵µÄ——MySQL Sandbox2.0£¬3.0Ò²½«ÒªÍƳö¡£
MySQL
SandboxÊÇÒ»¸ö·Ç³£¼òµ¥¿ì½Ý²¿ÊðMySQL¼¼ÊõµÄÒ»¸ö¹¤¾ßÌ×¼þ£¬Ëü¿É ......