K
K
Konstantin2016-01-29 16:48:31
MySQL
Konstantin, 2016-01-29 16:48:31

How to decide? Can't connect to local MySQL server through socket...?

There is a VPS with CentOS installed.
Sometimes websites get error messages: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad Odies, 2016-09-15
@dukonst

Hello. If your my.cfg is configured like this:
socket=/var/lib/mysql/mysql.sock
Then check the operation of the service
mysqladmin -u root -p status
If everything is ok, then the rights may be lost. Try to fix it like this
sudo chmod -R 755 /var/lib/mysql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question