我刚刚安装了 Ubuntu 18.04,并尝试获取 LAMP 堆栈。在安装过程中,在安装操作系统期间没有弹出 MySQL 服务器配置屏幕。我尝试使用无密码的 root 登录(默认无密码),权限被拒绝。运行 mysql_secure_installation,为 root 用户设置密码,然后我尝试使用我设置的密码登录,即使我输入了正确的密码,它仍然显示权限被拒绝。我尝试手动启动服务,结果超时了。清除 mysql-server 并更改为 mariadb-server,还是一样。这是 18.04 中 MySQL 服务器的一个错误吗?我在 17.10 中使用过 MySQL,没有问题。
journalctl -xe 摘录:
-- Unit mariadb.service has begun starting up.
May 13 05:55:09 v1 mysqld[4863]: 2018-05-13 5:55:09 140117780589696 [Note] /usr/sbin/mysqld (mysqld 10.1.29-MariaDB-6) starting as process 4863 ...
May 13 05:55:09 v1 audit[4863]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=48
May 13 05:55:09 v1 kernel: audit: type=1400 audit(1526190909.418:36): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld
May 13 05:56:39 v1 systemd[1]: mariadb.service: Start operation timed out. Terminating.
May 13 05:56:39 v1 audit[4863]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=48
May 13 05:56:39 v1 kernel: audit: type=1400 audit(1526190999.051:37): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld
May 13 05:56:41 v1 audit[4863]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=48
May 13 05:56:41 v1 kernel: audit: type=1400 audit(1526191001.179:38): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld
May 13 05:56:41 v1 audit[4863]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=48
May 13 05:56:41 v1 kernel: audit: type=1400 audit(1526191001.179:39): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld
May 13 05:56:41 v1 systemd[1]: mariadb.service: Failed with result 'timeout'.
May 13 05:56:41 v1 systemd[1]: Failed to start MariaDB database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mariadb.service has failed.