无法重启mysql

时间:2017-08-28 08:35:55

标签: mysql wordpress ubuntu digital-ocean

我获得了由DigitalOcean托管的WordPress网站的SendKeys "{ENTER}"。所以我检查了数据库的错误。

Error establishing a database connection返回

sudo /etc/init.d/mysql restart

stop: Unknown instance: start: Job failed to start 返回以下内容,因此磁盘未满?

df -h /

Filesystem Size Used Avail Use% Mounted on /dev/disk/by-label/DOROOT 20G 12G 6.9G 63% / 返回

sudo -u mysql mysqld

170828 4:33:48 [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. 170828 4:33:48 [Note] mysqld (mysqld 5.5.52-0ubuntu0.14.04.1) starting as process 18825 ... 返回

mysqld

所以有人知道mysql有什么问题吗?我怎么能重新开始呢?

编辑1:我注意到170828 4:34:17 [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. 170828 4:34:17 [Note] mysqld (mysqld 5.5.52-0ubuntu0.14.04.1) starting as process 18866 ... 170828 4:34:17 [Warning] Can't create test file /var/lib/mysql/chengtie.lower-test 170828 4:34:17 [Warning] Can't create test file /var/lib/mysql/chengtie.lower-test mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13) 170828 4:34:17 [ERROR] Aborting 170828 4:34:17 [Note] mysqld: Shutdown complete 下没有config.inc.phpconfig.sample.inc.php

4 个答案:

答案 0 :(得分:1)

  

mysqld:无法将dir更改为' / var / lib / mysql /' (错误代码:13)

那是"权限"。我怀疑MySQL是以root用户之外的其他用户身份安装的。建议您重新安装(以root用户身份),特别是如果您还没有任何数据。

答案 1 :(得分:0)

您是否看过这篇文章:Ubuntu - 12.04 - MySql won't start by using service mysql start

您可以尝试

mysqld --verbose
获取更多信息

答案 2 :(得分:0)

define('DB_HOST', 'localhost');不应该是'localhost',它应该是mysql服务器的主机名。

答案 3 :(得分:0)

/ var / lib / mysql /

似乎存在权限问题

https://dba.stackexchange.com/a/106135可以解决它。