Error: 'Can't connect to local MySQL server through socket '/var/lib/mysql. sock' (2) ', connectmysql. sock
[Root @ luozhonghua ~] #/Usr/bin/mysqladmin-u root password 'aaaaa'
/Usr/bin/mysqladmin: connect to server at 'localhost' failed
Error: 'Can't connect to local MySQL server through socket '/var/lib/mysql. sock' (2 )'
Check that mysqld is running and that the socket: '/var/lib/mysql. sock' exists!
Solution:
1 "/etc/rc. d/init. d/mysqld status to check whether mysql has started
2 "service mysqld start
When mysql is started, the following ERROR occurs: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib.
1. Check/etc/rc. d/init. d/mysqld status to see if m y s q l has been started.
Check whether the permission is correct.
2. Check whether your mysql. sock is in that location,
Mysql-u your mysql username-p-S/var/lib/mysql. sock
3. Try: service mysqld start
Mysql connection failure Can't connect to local MySQL server through socket '/var/lib/mysql/mysqlsock' (2)
The/etc/my. cnf file is incorrect. You need to create a new file as follows:
Cd mysql-VERSION to the directory of the decompressed File
Copy
Cp support-files/my-medium.cnf/etc/my. cnf
Reinitialize and create an authorization table
Bin/mysql_install_db -- user = mysql
Start the service
Bin/mysqld_safe -- user = mysql &