Comments - Default Data Directory for MariaDB?
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
After installing MariaDB 10.4.12, my default datadir is /var/lib/mysql. I could successfully start mysqld. But when I update /etc/my.cnf as follows:
[mysqld] datadir=/mysql_xxx
and start mariadb again, it returned the following error messages:
May 13 09:56:00 db1 systemd: Starting MariaDB 10.4.12 database server... May 13 09:56:00 db1 mysqld: 2020-05-13 9:56:00 0 [Note] /usr/sbin/mysqld (mysqld 10.4.12-MariaDB) starting as process 4253 ... May 13 09:56:00 db1 mysqld: 2020-05-13 9:56:00 0 [Warning] Can't create test file /mysql_joal/dodbdb1.lower-test May 13 09:56:00 db1 mysqld: 2020-05-13 9:56:00 0 [ERROR] mysqld: File '/mysql_joal/aria_log_control' not found (Errcode: 13 "Permission denied") May 13 09:56:00 db1 mysqld: 2020-05-13 9:56:00 0 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/mysql_joal/aria_log_control'
There is "Permission denied" error. Here below is /mysql_joal directory permission:
drwxr-xr-x. 5 mysql mysql 206 May 13 09:55 mysql_joal
Here below is files permission under mysql_joal directory:
-rw-rw----. 1 mysql mysql 24576 May 13 09:49 aria_log.00000001 -rw-rw----. 1 mysql mysql 52 May 13 09:49 aria_log_control -rw-rw----. 1 mysql mysql 976 May 13 09:49 ib_buffer_pool -rw-rw----. 1 mysql mysql 12582912 May 13 09:49 ibdata1 -rw-rw----. 1 mysql mysql 50331648 May 13 09:49 ib_logfile0 -rw-rw----. 1 mysql mysql 50331648 Feb 21 12:06 ib_logfile1 -rw-rw----. 1 mysql mysql 0 Feb 21 14:22 multi-master.info drwx------. 2 mysql mysql 4096 Feb 21 12:06 mysql drwx------. 2 mysql mysql 20 Feb 21 12:06 performance_schema drwx------. 2 mysql mysql 20 Feb 21 12:06 test
Well, since a few month I have the same error under OpenSuSE linux. Earlier changes of datadir where possible and they caused no errors. I guess this might be connected with some other security mechanisms like apparmor.
Did you find the solution ?
The solution was to switch apparmor off. It is shown here how to do it: https://stackoverflow.com/questions/46111723/usr-sbin-mysqld-error-while-loading-shared-libraries-liblz4-so-1-cannot-open