MySql stopped and I can't restart it.

  • Posted December 7, 2013

I received the following error:

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

So after restarting the server and trying to figure out what was going on I tried reinstalling mysql with this: apt-get install mysql-server

Then I restarted apache and still keep getting the same error message.

What could be causing this? Can anyone point me in the right direction to trouble shoot this issue?



Log in as super user or use sudo Open /etc/mysql/my.cnf using gedit Find bind-address, and change its value to the database server host machine’s IP address. For me, it was localhost or Save and close the file. Come back to terminal and execute sudo service mysql start

And it worked for me.

Same problem I have found with 512 plan. You can view it

I’m having the same issue, 512MB droplet.

mysql is running and I can log into it.

I can see all of my tables still so it’s not likely someone found an SQL injection attack and my passwords are all the same.

I have rebooted my droplet.

free total used free shared buffers cached Mem: 501868 327452 174416 21180 23376 174676 -/+ buffers/cache: 129400 372468 Swap: 0 0 0

df Filesystem 1K-blocks Used Available Use% Mounted on /dev/vda 20509308 7145252 12299200 37% / none 4 0 4 0% /sys/fs/cgroup udev 240132 4 240128 1% /dev tmpfs 50188 312 49876 1% /run none 5120 0 5120 0% /run/lock none 250932 0 250932 0% /run/shm none 102400 0 102400 0% /run/user

As you can see, despite the small droplet there is tons of RAM and disk space.

What gives?

[EDIT] Okay it seems like my mysql server started responding after I wrote this. Random…

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

It’s a 2gb droplet and I did reboot. In case anyone else runs into this situation I checked the logs and didn’t see anything that would indicate a problem. I reinstalled MySql, rebooted the droplet and updated apache. I couldn’t find anything that would be causing MySql to not work. I finally ended up taking a snapshot of the droplet, creating a new droplet from that snapshot image and adding the DNS info to the new droplet IP for all the sites on the old droplet. Then I restarted the new droplet and everything was fixed and working properly.

Hi! same problem in a 2GB droplet! It randomly crashes

Killed 5 hours trying to figure out what causes the error. The solution was stupid simple, I just needed to free up some disk space on my droplet. I had a few huge log files that had eaten up all the free space so mysql simply couldn’t start and gave me the ERROR 2002 (HY000). Check how much free space you have by doing **df -h ** command in terminal.

Same problem here using 512 plan, you can view media creeks

Hi, same problem

Hi, same problem here and if I restart mysql, it would FAIL. Everything looks fine after reboot, however this happens frequently. Does anyone know how this happens?

I have a new droplet and experienced this both times I shut it down. I just tried entering the console and inputting sudo service mysql restart. For me, this worked immediately.

This my website : Chu Doanh Nghiep Me too, ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111)

I was trying reboot, because mysql not running

It’s a 2gb droplet and I have rebooted.

Try rebooting your droplet: <br>sudo reboot