Problem:
Run under normal user privileges: Mysql-u root-p, after carriage return if the following error occurs: Error 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/run /mysqld/mysqld.sock ' (2)
This error means that the Mysqld.sock file was not found.
Workaround:
First go to Superuser root privileges sudo-i or su-root
Switch to the default directory Cd/var/lib/mysql to see if the file exists (you can do the following in the directory again).
Execute Command Ps-aux | grep MySQL
View the running process and kill the process (MySQL process)
Executing the command kill process ID
Execute the sudo service MySQL start and it will appear MySQL start/running, process 6106, stating that the MySQL services started successfully!
The MySQL database can be accessed by executing mysql-u root-p here.
Note: This program refers to other users of the article, and after their own attempts to succeed! May not be perfect! Just hope to provide you with a little help! Thank you!
Linux environment startup MySQL database can not find Mysqld.sock solution!