在Ubuntu 18.04上更改Mysql数据目录时出现问题

在Ubuntu 18.04上更改Mysql数据目录时出现问题,mysql,apparmor,Mysql,Apparmor,我正在尝试更改Ubuntu 18.04上的Mysql数据目录。 我遵循了这里的确切说明: 但当我走到这一步时: sudo systemctl restart apparmor 我得到以下错误: Job for apparmor.service failed because the control process exited with error code. See "systemctl status apparmor.service" and "journalctl -xe" for det

我正在尝试更改Ubuntu 18.04上的Mysql数据目录。 我遵循了这里的确切说明:

但当我走到这一步时:

sudo systemctl restart apparmor
我得到以下错误:

Job for apparmor.service failed because the control process exited with error code.
See "systemctl status apparmor.service" and "journalctl -xe" for details.
systemctl status apparmor.service的输出为:

apparmor.service - AppArmor initialization
   Loaded: loaded (/lib/systemd/system/apparmor.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2019-08-23 09:34:03 CEST; 41s ago
     Docs: man:apparmor(7)
           http://wiki.apparmor.net/
  Process: 18786 ExecStart=/etc/init.d/apparmor start (code=exited, status=123)
 Main PID: 18786 (code=exited, status=123)

Aug 23 09:34:03 toto-X777K apparmor[18786]: Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
Aug 23 09:34:03 toto-X777K apparmor[18786]: AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at 
Aug 23 09:34:03 toto-X777K apparmor[18786]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
Aug 23 09:34:03 toto-X777K apparmor[18786]: Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
Aug 23 09:34:03 toto-X777K apparmor[18786]: AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at 
Aug 23 09:34:03 toto-X777K apparmor[18786]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
Aug 23 09:34:03 toto-X777K apparmor[18786]:    ...fail!
Aug 23 09:34:03 toto-X777K systemd[1]: apparmor.service: Main process exited, code=exited, status=123/n/a
Aug 23 09:34:03 toto-X777K systemd[1]: apparmor.service: Failed with result 'exit-code'.
Aug 23 09:34:03 toto-X777K systemd[1]: Failed to start AppArmor initialization.
journalctl-xe的输出为:

Aug 23 09:34:03 toto-X777K audit[18902]: AVC apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/snap/core/7396/usr/li
Aug 23 09:34:03 toto-X777K audit[18902]: AVC apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/snap/core/7396/usr/li
Aug 23 09:34:03 toto-X777K audit[18903]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18904]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18905]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18907]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18906]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18908]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18909]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18912]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18913]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18911]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18910]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18914]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18915]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18919]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18920]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18916]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18917]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18921]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18923]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18922]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K audit[18918]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=
Aug 23 09:34:03 toto-X777K apparmor[18786]:    ...fail!
Aug 23 09:34:03 toto-X777K systemd[1]: apparmor.service: Main process exited, code=exited, status=123/n/a
Aug 23 09:34:03 toto-X777K systemd[1]: apparmor.service: Failed with result 'exit-code'.
Aug 23 09:34:03 toto-X777K systemd[1]: Failed to start AppArmor initialization.
-- Subject: Unit apparmor.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--  
-- Unit apparmor.service has failed.
-- 
-- The result is RESULT.
Aug 23 09:34:03 toto-X777K sudo[18781]: pam_unix(sudo:session): session closed for user root
lines 1022-1056/1056 (END)

您有什么解决问题的建议吗?

您解决了吗?我也有同样的问题,我找不到解决办法。你解决了吗?我也有同样的问题,我找不到解决办法