ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/tmp/ Mysql.sock ' (111)
1, [[email protected] ~]# Find/-name Mysql.sock
/var/lib/mysql/mysql.sock
To create a symbolic connection:
Ln-s/var/lib/mysql/mysql.sock/tmp/mysql.sock
2, vi/etc/my.conf
Check if the downstream content exists :
[Client]
Socket=/tmp/mysql.sock
MySQL I can't find them . Mysql.sock or the file is empty, view the log as follows:
[ERROR] Can ' t start server:bind on TCP/IP Port:cannot assign requested address
[ERROR] Do you already has another MYSQLD server running on port:3306?
[ERROR] Aborting
hint is The port may be occupied and executed:
greatmoo:~# netstat-anp |grep "3306"
vi/etc/my.cnf, put Port Change into 3307 :
greatmoo:~# vi/etc/mysql/my.cnf
[Client]
Port = 3307
# ...
[Mysqld]
Port = 3307
# ... ..
ready to start after savingMySQL, and then startMySQLit worked.
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (Usingpassword:no)
#/etc/init.d/mysql stop
# mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
# mysql-u root mysql
mysql> UPDATE user SET Password=password (' newpassword ') whereuser= ' root ';
mysql> FLUSH privileges;
mysql> quit
#/etc/init.d/mysql restart
# Mysql-uroot- p
Enter password: < Enter the newly created password newpassword>
mysql>
Method Two:
Direct Use/etc/mysql/debian.cnfin the file[Client]section provides the user name and password:
# mysql-udebian-sys-maint-p
Enter Password: <input[Client]section's password>
mysql> UPDATE user SET Password=password (' newpassword ') whereuser= ' root ';
mysql> FLUSH privileges;
Mysql> quit
# mysql-uroot-p
Enter Password: <Enter the newly created passwordnewpassword>
Mysql>
/span> method Three:
root
# mysql-uroot-p
Ente R password: < enter /ETC/MYSQL/DEBIAN.CNF file [client] >
Last note: Do not forget to turn off the firewall so that the external network cannot access the host's database port.
Start Error : File './mysql-bin.index ' not Found (errcode:13)
1 errcode mysql
2 , chown Mysql.mysql-r < Mysql-bin.index the directory where >
This article from "Yun Vil Szeng" blog, reproduced please contact the author!
MySQL FAQ solution