Problem Description:
There is no problem finding/var/lib/mysql/mysql.sock or being used with mysql-uroot-p login.
You can log in using the following command: Mysql-p--socket=/tmp/mysql.sock
Workaround:
1. Most mysql is installed in rpm mode. It will automatically look for/var/lib/mysql/mysql.sock this file.
Check the location of the Mysql.sock.
The field of the socket through the/ETC/MY.CNF.
If the socket looks like this:
Socket=/tmp/mysql.sock
2. Add a soft connection (equivalent to a shortcut in Windows) for Mysql.sock. such as the actual mysql.sock under the/tmp/.
Run the following command.
Ln-s/tmp/mysql.sock/var/lib/mysql/mysql.sock
If it is the SUSE system using YaST installed MySQL, but how also can not start up, a start said can not find Mysql.sock, using the Find command also found Mysql.sock, find some information, only to find that need to first to/etc/ Start the MySQL service under the INIT.D path,./mysql start (see if you need to use root), after the service is started, you can connect to the database.
/var/lib/mysql/mysql.sock the wrong solution