为什么mysql无法在Ubuntu

时间:2018-04-05 01:53:02

标签: mysql ubuntu

今天当我尝试重新启动mysql时,显示

root@S128046:~# service mysql restart
Job for mysql.service failed because the control process exited with error 
code. See "systemctl status mysql.service" and "journalctl -xe" for details.

如果我尝试systemctl status mysql.service,则会说:

root@S128046:~# systemctl status mysql.service
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since Thu 2018-04-05 09:45:48 CST; 11s ago
 Main PID: 19848 (code=exited, status=1/FAILURE);         : 19849 (mysql-systemd-s)
    Tasks: 2
   Memory: 336.0K
      CPU: 754ms
   CGroup: /system.slice/mysql.service
           └─control
             ├─19849 /bin/bash /usr/share/mysql/mysql-systemd-start post
             └─19903 sleep 1

Apr 05 09:45:48 S128046.domain systemd[1]: Stopped MySQL Community Server.
Apr 05 09:45:48 S128046.domain systemd[1]: Starting MySQL Community Server...
Apr 05 09:45:51 S128046.domain systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

而journalctl -xe说:

-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has begun starting up.
Apr 05 09:47:25 S128046.domain audit[20171]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/20171/status" pid=20171 comm="mysqld" req
Apr 05 09:47:25 S128046.domain audit[20171]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=20171 comm="mysq
Apr 05 09:47:25 S128046.domain audit[20171]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/20171/status" pid=20171 comm="mysqld" req
Apr 05 09:47:25 S128046.domain kernel: audit: type=1400 audit(1522892845.214:527): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/20171/s
Apr 05 09:47:25 S128046.domain kernel: audit: type=1400 audit(1522892845.214:528): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/
Apr 05 09:47:25 S128046.domain kernel: audit: type=1400 audit(1522892845.214:529): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/20171/s
Apr 05 09:47:27 S128046.domain systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Apr 05 09:47:56 S128046.domain 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.
Apr 05 09:47:56 S128046.domain systemd[1]: mysql.service: Unit entered failed state.
Apr 05 09:47:56 S128046.domain systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 05 09:47:56 S128046.domain systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
-- Unit mysql.service has begun starting up.
Apr 05 09:47:56 S128046.domain kernel: audit: type=1400 audit(1522892876.943:530): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/20273/s
Apr 05 09:47:56 S128046.domain kernel: audit: type=1400 audit(1522892876.943:531): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/
Apr 05 09:47:56 S128046.domain kernel: audit: type=1400 audit(1522892876.943:532): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/20273/s
Apr 05 09:47:56 S128046.domain audit[20273]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/20273/status" pid=20273 comm="mysqld" req
Apr 05 09:47:56 S128046.domain audit[20273]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=20273 comm="mysq
Apr 05 09:47:56 S128046.domain audit[20273]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/20273/status" pid=20273 comm="mysqld" req
Apr 05 09:47:59 S128046.domain systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

我不知道为什么mysql过去几个月运作良好。 任何帮助将不胜感激,谢谢你。

1 个答案:

答案 0 :(得分:0)

尝试在ubuntu中使用超级用户

<flavor's name>Implementation
这可能有用。