Symptoms
MySQL fails to start, and errors similar to the following may be found in the MySQL error log.
Apr 12 23:36:38 host.domain.tld mysqld[220238]: 2023-04-13T05:36:38.602614Z 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 2976664e-d9bd-11ed-ac8a-a4bf01665a22.
Apr 12 23:36:38 host.domain.tld mysqld[220238]: mysqld: File '/home/mysql/auto.cnf' not found (OS errno 13 - Permission denied)
Apr 12 23:36:38 host.domain.tld mysqld[220238]: 2023-04-13T05:36:38.602827Z 0 [ERROR] [MY-010183] [Server] Failed to create file(file: '/home/mysql/auto.cnf', errno 13)
Apr 12 23:36:38 host.domain.tld mysqld[220238]: 2023-04-13T05:36:38.602846Z 0 [ERROR] [MY-010076] [Server] Initialization of the server's UUID failed because it could not be read from the auto.cnf file. If this is a new server, the initialization failed because it was not possible to generate a new UUID.
Apr 12 23:36:38 host.domain.tld mysqld[220238]: 2023-04-13T05:36:38.602893Z 0 [ERROR] [MY-010119] [Server] Aborting
Description
When MySQL is set to "enforce" mode in AppArmor, MySQL can fail to start.
Workaround
Disabling AppArmor for MySQL will allow MySQL to start.
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Run the
apparmor_status
command to verify thatmysqld
is under the "processes are in enforce mode." section.[root@server ~]cPs# apparmor_status
apparmor module is loaded.
30 profiles are loaded.
30 profiles are in enforce mode.
...
0 profiles are in complain mode.
1 processes have profiles defined.
1 processes are in enforce mode.
/usr/sbin/mysqld (1914)
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
[root@server ~]cPs# - Run the following commands to disable AppArmor for MySQL.
ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
apparmor_parser -R /etc/apparmor.d/disable/usr.sbin.mysqld
- Run the
apparmor_status
command to verify thatmysqld
is no longer under the "processes are in enforce mode." section.[root@server ~]cPs# apparmor_status
apparmor module is loaded.
29 profiles are loaded.
29 profiles are in enforce mode.
...
0 profiles are in complain mode.
0 processes have profiles defined.
0 processes are in enforce mode.
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
[root@server ~]cPs#