Today out of the blue stopped running MySQL on a Ubuntu server. When I try to log in there, I get this error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Inspecting the error:
mysqld --verbose
160408 3:21:24 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
160408 3:21:24 [ERROR] Fatal error: Can't change to run as user 'mysql' ; Please check that the user exists!
160408 3:21:24 [ERROR] Aborting
160408 3:21:24 [Note] mysqld: Shutdown complete
I tried sudo service mysql start
:
start: Job failed to start
I also tried:
ps ax | grep mysql
4127 pts/0 S+ 0:00 grep --color=auto mysql
and
sudo chown mysql:root -R /var/lib/mysql
chown: invalid user: `mysql:root'
If I try to list all users in the system:
compgen -u
root
ram
sshd
nobody
deployer
I also checked if I am not running out of space on the server:
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 79G 27G 49G 35% /
udev 3.9G 4.0K 3.9G 1% /dev
tmpfs 1.6G 204K 1.6G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 3.9G 0 3.9G 0% /run/shm
none 100M 0 100M 0% /run/user
But there's plenty of space.
If I try to check the socket: cd /var/run/mysqld/
, then:
-bash: cd: /var/run/mysqld/: No such file or directory
How to fix this issue? Or at least - how to save the data from the database?
Thank you very much!