mysql 服务在启动时超时

mysql service gets timed out while starting

启动 mysql 超时。我不知道为什么。

我按照建议查看了日志文件,只是得知它正在超时,但不明白为什么。我什至尝试重新安装 lamp 堆栈,但这是相同的结果。

toor@linux:~$ sudo /etc/init.d/mysql start
[....] Starting mysql (via systemctl): mysql.service
Job for mariadb.service failed because a timeout was exceeded.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
failed!


toor@linux:~$ systemctl status mariadb.service
● mariadb.service - MariaDB 10.1.37 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Thu 2019-03-28 18:52:25 IST; 1min 13s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 14867 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, stat
  Process: 14790 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`
  Process: 14785 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCC
  Process: 14783 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCE
 Main PID: 14867 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"
lines 1-11/11 (END)

我尝试粘贴 journalctl -xe 的结果,但无法提交,因为其中有相当多的代码。所以这里是 output.

sudo aa-status 向您展示 apparmor 正在做什么。

sudo apt-get install apparmor-utils 添加了一些命令,使 apparmor 配置文件更容易。

sudo aa-complain /usr/sbin/mysqld 将个人资料从 "enforce" 转为抱怨。

sudo service apparmor reload 重启 apparmor,瞧... sudo /etc/init.d/mysql start重新启动服务器。