因此,在服務器重新引導後,MySQL不會重新啓動/啓動。沒有編輯配置文件/進行任何更改。 我有同樣的問題,因爲這question其中的AppArmor是導致這些日誌條目:mysql不會啓動Ubuntu 16.04.2 x64
Sep 27 11:18:53 staging audit[2986]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/2986/status" pid=2986 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=112 ouid=112
Sep 27 11:18:53 staging audit[2986]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=2986 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=112 ouid=0
Sep 27 11:18:53 staging audit[2986]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/2986/status" pid=2986 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=112 ouid=112
當這些execptions添加到/etc/apparmor.d/usr.sbin.mysqld
爲:
# fix issue with mysql not restarting
/proc/*/status r,
/sys/devices/system/node/ r,
/sys/devices/system/node/node0/meminfo r,
# Allow network access
然後作爲root:service apparmor reload; service mysql restart;
日誌現在只顯示:
Sep 27 11:25:10 staging 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.
Sep 27 11:25:10 staging systemd[1]: mysql.service: Unit entered failed state.
Sep 27 11:25:10 staging systemd[1]: mysql.service: Failed with result 'exit-code'.
Sep 27 11:25:10 staging systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Sep 27 11:25:10 staging 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.
Sep 27 11:25:10 staging 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.
Sep 27 11:25:11 staging systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
我還沒有做任何配置更改,所以我真的不知道還有什麼地方看。我要重新安裝的MySQL,但是,我有我沒有備份的數據:(請幫助
我試圖重新安裝mysql服務器,但仍然只有一個錯誤:'mysql.service:主進程退出,代碼=退出,狀態= 1 /失敗' – jwtea