Yesterday at home using Ubuntu installed a MySQL, pretty good outfit. After the installation is complete. To start the MySQL client remote access. I just put the my.cnf in the config file to allow only native machine access is: 127.0.0.1 commented out to him. As shown:
Then restart Mysql:sudo service MySQL restart boot ok
Then I restarted the computer again. The error 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2) is displayed when you go to start MySQL.
Workaround:
First, check to see if the port exists. See if there's 3306.
Check that the MySQL configuration file is correct cat my.cnf
Page Tip/var/lib/mysql/mysql.sock indicates that the Mysql.sock is generated after startup
Where's the Mysql.sock file? Find/-name ' *.socket '
Parse error log
Cd.. /var/log/mysql
# tail-f Error.log
Add/var/log/mysql and all subordinate subdirectories with permissions:
Also add chmod 777 plus permissions to the current user: See error log plus permissions directory ...
Reboot restart your computer
sudo service MySQL restart restart MySQL success
Solution to connect MySQL hint can ' t connect to local MySQL server through socket