MySQL server vanished

Posted December 1, 2013 7.8k views
Hi, MySQL server is vanished and I don't know why. Restoring previous (and stable) backups won't help at all. Running htop command, there are no instances of mysql is shown and service mysql restart gives the following error: stop: Unknown instance: start: Job failed to start I checked if it's installed by apt-get install mysql-server: "mysql-server is already the newest version." I don't want to remove and re-install it because I don't want to lose existing tables. Command "mysql" gives this error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Any ideas what might the problem be?
1 comment

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.

Submit an Answer
6 answers
After a deep research, I found out that mysql.sock file has dissapeared somehow. I couldn't bring it back no matter what I have tried.
Temporary solution: Install mariadb on top of mysql. It fixes the problem.
It disappearing means that MySQL/MariaDB is not running. Check MySQL's error logs and see if you can find any pointers on why it's crashing.
I'm having the same issue with mysql on my server it's the ubuntu 12.04 x64 image. mySQL is apparently crashing overnight, and a restart brings it back. when I run service mysql restart, I get stop: unknown instance:

It then restarts successfully. I don't have any errors in /var/log/mysql.log or /var/log/mysql.err

Any help would be greatly appreciated.

Another note: I tried to run fsck to see if there is an issue with the file system and got this error:

root@vithefiddler:~# fsck -v
fsck from util-linux 2.20.1
fsck.ext4: Unable to resolve 'UUID=b96601ba-7d51-4c5f-bfe2-63815708aabd'

This is what my fstab looks like (I haven't changed it since the image instantiation.)

# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/vda1 during installation
UUID=b96601ba-7d51-4c5f-bfe2-63815708aabd / ext4 noatime,errors=remount-ro 0 1
by Etel Sverdlov
Linux swaps allow a system to harness more memory than was originally physically available. Here's how to set up a linux swap file on Ubuntu 12.04

I already have mariadb. The server is up and running, it’s not a memory problem. But suddenly all my databases have disappeared. Any ideas what may be happening? Has DO changed something and the data has gone? All my Wordpress powered databases need some data!