Apparmor DENIED Mysql

2

Save personal.

I'm facing a small problem with my MYSQL in Linux Mint. When I try to initialize the service, APPARMOR denies the permission, it follows the logs:

Ago 28 09:07:42 Comerlatto-NTB systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Ago 28 09:07:42 Comerlatto-NTB systemd[1]: Stopped MySQL Community Server.
-- Subject: A unidade mysql.service concluiu o desligamento
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A unidade mysql.service concluiu o desligamento.
Ago 28 09:07:42 Comerlatto-NTB systemd[1]: Starting MySQL Community Server...
-- Subject: Unidade mysql.service sendo iniciado
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A unidade mysql.service está sendo iniciada.
Ago 28 09:07:42 Comerlatto-NTB audit[31015]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/31015/status" pid=31015 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=122 ouid=122
Ago 28 09:07:42 Comerlatto-NTB audit[31015]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=31015 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=122 ouid=0
Ago 28 09:07:42 Comerlatto-NTB audit[31015]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/31015/status" pid=31015 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=122 ouid=122
Ago 28 09:07:42 Comerlatto-NTB kernel: audit: type=1400 audit(1503922062.148:231): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/31015/status" pid=31015 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=122 ouid=122
Ago 28 09:07:42 Comerlatto-NTB kernel: audit: type=1400 audit(1503922062.148:232): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=31015 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=122 ouid=0
Ago 28 09:07:42 Comerlatto-NTB kernel: audit: type=1400 audit(1503922062.148:233): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/31015/status" pid=31015 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=122 ouid=122
Ago 28 09:07:42 Comerlatto-NTB systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since Seg 2017-08-28 09:10:14 BRT; 15s ago
  Process: 31784 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 31777 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 31784 (code=exited, status=1/FAILURE);         : 31785 (mysql-systemd-s)
    Tasks: 2
   Memory: 344.0K
      CPU: 245ms
   CGroup: /system.slice/mysql.service
           └─control
             ├─31785 /bin/bash /usr/share/mysql/mysql-systemd-start post
             └─31849 sleep 1

Ago 28 09:10:14 Comerlatto-NTB systemd[1]: Starting MySQL Community Server...
Ago 28 09:10:14 Comerlatto-NTB systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

Would anyone know what it could be? In my lay vision, APPARMOR is denying read access, I have already looked at various forums and no solution has helped me.

    
asked by anonymous 28.08.2017 / 14:16

1 answer

1

The general guideline indicated to solve this problem is to change the load permission of the apparmour.

Notice the message that indicates which resource was deprived of permission and which permission was requested:

Aug 28 09:07:42 Comerlatto-NTB audit [31015]: AVC apparmor="DENIED" operation="open" profile="/ usr / sbin / mysqld" name="/

Edit the file

  

/etc/apparmor.d/usr.sbin.mysqld

and include the required permissions, in the case:

/proc/* r,
/sys/devices/system/node/* r

Restart your service:

sudo service mysql stop
sudo service mysql start
    
06.11.2017 / 14:16