Question
MySql stopped and I can't restart it.
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.
×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.
×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
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?
thanks kama, I guess it’s out of memory… Isn’t 512M memory enough to run a blog on CentOS?
@kindpire There are a lot of different factors that come into play when considering the memory requirements for MySql. Unfortunately, many WordPress plugins authors don’t prioritize performance. I’d start with an audit of the plugins you’re using. Either way, adding a swap file to your server should help by giving to some wiggle room when it comes to memory usage. Check out: How To Add Swap on CentOS 7
@asb Hi, thanks for quick reply! Yes, I guess the problems should be in my MySQL (MariaDB) setting. Each time, once I installed a new plugin, it would crash. After reboot the whole machine, everything goes fine again.
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.
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…
Same problem I have found with 512 plan. You can view it http://mediacreeks.com
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 127.0.0.1
Save and close the file.
Come back to terminal and execute sudo service mysql start
And it worked for me.