【发布时间】:2017-08-28 08:35:55
【问题描述】:
我的 WordPress 网站由 DigitalOcean 托管,我收到了 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 返回
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
那么有谁知道mysql有什么问题吗?怎么重启?
编辑 1: 我注意到/var/lib/mysql/phpmyadmin 下没有config.inc.php 或config.sample.inc.php。
【问题讨论】:
-
还要确保
wp-config.php具有正确的数据库凭据。 -
尝试检查apparmor设置,详情见这里askubuntu.com/questions/75059/…
-
wp-config.php看起来不错,虽然有define('DB_HOST', 'localhost');(我不知道为什么使用localhost)。 -
/var/lib/mysql/ 似乎有问题dba.stackexchange.com/a/106135 可以帮助你。
标签: mysql wordpress ubuntu digital-ocean