MySQL停止在Ubuntu上运行:无法更改为以用户'mysql'运行。如何保存数据?

时间:2016-04-08 07:23:25

标签: mysql ubuntu

今天,在Ubuntu服务器上停止运行MySQL。 当我尝试登录时,我收到此错误:

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

检查错误:

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

我尝试了sudo service mysql start

start: Job failed to start

我也尝试过:

ps ax | grep mysql
 4127 pts/0    S+     0:00 grep --color=auto mysql

sudo chown mysql:root -R /var/lib/mysql
chown: invalid user: `mysql:root'

我还检查了服务器上是否没有空间:

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

但是有足够的空间。

如果我尝试检查套接字:cd /var/run/mysqld/,那么:

-bash: cd: /var/run/mysqld/: No such file or directory

如何解决此问题?或者至少 - 如何从数据库中保存数据?

非常感谢!

0 个答案:

没有答案