首页 > 解决方案 > Mysql 不会在 Ubuntu 服务器 16.04 上启动或重新启动

问题描述

嗨,当我尝试重新启动 mySQL 时,我已经使用 ubuntu 服务器 16.04 创建了一个虚拟机,我收到以下错误 mysql.service 的作业失败,因为控制进程退出并显示错误代码。

systemctl status mysql.service 报错

 Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
 Active: activating (start-post) (Result: exit-code) since Thu 2019-05-30 22:31:32 SAST; 28s ago
 Process: 11476 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
 Process: 11467 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 11476 (code=exited, status=1/FAILURE);         : 11477 (mysql-systemd-s)
 Tasks: 2
 Memory: 320.0K
 CPU: 850ms
 CGroup: /system.slice/mysql.service
       └─control
         ├─11477 /bin/bash /usr/share/mysql/mysql-systemd-start post
         └─11564 sleep 1

 May 30 22:31:32 richardchristiaan systemd[1]: Starting MySQL Community Server...
 May 30 22:31:35 richardchristiaan systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

journalctl -xe 错误代码

            -- Unit mysql.service has finished shutting down.
        May 30 22:33:35 richardchristiaan systemd[1]: Starting MySQL Community Server...
        -- Subject: Unit mysql.service has begun start-up
        -- Defined-By: systemd
        -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
        --
        -- Unit mysql.service has begun starting up.
        May 30 22:33:35 richardchristiaan audit[11888]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/11888/status" pid=11888 comm="mysqld" requ
        May 30 22:33:35 richardchristiaan audit[11888]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=11888 comm="mysql
        May 30 22:33:35 richardchristiaan audit[11888]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/11888/status" pid=11888 comm="mysqld" requ
        May 30 22:33:35 richardchristiaan kernel: audit: type=1400 audit(1559248415.878:322): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/11888/st
        May 30 22:33:35 richardchristiaan kernel: audit: type=1400 audit(1559248415.878:323): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/s
        May 30 22:33:35 richardchristiaan kernel: audit: type=1400 audit(1559248415.878:324): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/11888/st
        May 30 22:33:38 richardchristiaan systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
        May 30 22:34:06 richardchristiaan systemd[1]: Failed to start MySQL Community Server.
        -- Subject: Unit mysql.service has failed
        -- Defined-By: systemd
        -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
        --
        -- Unit mysql.service has failed.
        --
        -- The result is failed.
        May 30 22:34:06 richardchristiaan systemd[1]: mysql.service: Unit entered failed state.
        May 30 22:34:06 richardchristiaan systemd[1]: mysql.service: Failed with result 'exit-code'.
        May 30 22:34:06 richardchristiaan systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
        May 30 22:34:06 richardchristiaan systemd[1]: Stopped MySQL Community Server.
        -- Subject: Unit mysql.service has finished shutting down
        -- Defined-By: systemd
        -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
        --
        -- Unit mysql.service has finished shutting down.
        May 30 22:34:06 richardchristiaan systemd[1]: Starting MySQL Community Server...
        -- Subject: Unit mysql.service has begun start-up
        -- Defined-By: systemd
        -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
        --
        -- Unit mysql.service has begun starting up.
        May 30 22:34:06 richardchristiaan audit[11991]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/11991/status" pid=11991 comm="mysqld" requ
        May 30 22:34:06 richardchristiaan audit[11991]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=11991 comm="mysql
        May 30 22:34:06 richardchristiaan audit[11991]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/11991/status" pid=11991 comm="mysqld" requ
        May 30 22:34:06 richardchristiaan kernel: audit: type=1400 audit(1559248446.611:325): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/11991/st
        May 30 22:34:06 richardchristiaan kernel: audit: type=1400 audit(1559248446.611:326): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/s
        May 30 22:34:06 richardchristiaan kernel: audit: type=1400 audit(1559248446.611:327): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/11991/st
        May 30 22:34:08 richardchristiaan systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

这是我第一次使用 ubuntu,所以任何帮助将不胜感激

标签: mysqlubuntuvirtual-machine

解决方案


推荐阅读