0

By looking on stack overflow questions, i've noticed there are tons of questions about this error, but this time it seems different, the service is working, but sometimes it stop working and show the famous

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

and it last until I reboot the system, or restart mysql service

any suggestion? it's strange because after the reboot the webserver will work for some time, but after a day it will stop.

i'm posting a test to show you what's happening when this problem occurs

root@kiLNX:~# mysql -u XXX -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (111)

root@kiLNX:~# service mysql stop
mysql stop/waiting

root@kiLNX:~# service mysql start
mysql start/running, process 3340

root@kiLNX:~# mysql -u XXX -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Naraj
  • 457
  • 5
  • 8
  • Hello, try to look on that path '/var/run/mysqld/mysqld.sock'and if there is no dir, you can try to make it manually, likie in this video https://www.youtube.com/watch?v=oXjJRrbKjp0 or maybe it's problem of chmod permisions, or something like that :) – xxxvodnikxxx Dec 17 '15 at 09:16
  • btw You can also try to look in there http://stackoverflow.com/questions/11657829/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run It looks like the same problem – xxxvodnikxxx Dec 17 '15 at 09:17
  • 1
    thanks vodnik, I've checked the link but my problem is different, the sql server now is actually working, as it was yesterday, and the day before... but after something like 20 hours of uptime it show this error, this is why it's really strange, after a restart it work again, but for less than a day :( – Naraj Dec 17 '15 at 09:21
  • Have you ever checked how many connections are there in mysql server? – Altmish-E-Azam Dec 17 '15 at 09:32
  • Not yet, is in there any way to check after the problem occurs? (and I can't access to mysql command line) or I have to check every hour untill the problem occurs? – Naraj Dec 17 '15 at 09:38

0 Answers0