W3Schools Learner's Blog

w3Schools programming knowledge summary website

div

5/02/2018

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Today my MYSQL is not working.
When i try to connect mysql server, as follows:
mysql -u root -p
I get the error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
this because my database server is not started, start it using:
//centos 7 server
systemctl start mysqld
//centos 6 server
service mysqld start

No comments:

Post a Comment

Note: only a member of this blog may post a comment.