I need to change the MariaDB datadir in Centos 7. The default execution works fine, but when I set the datadir property inside /etc/my.cnf I cannot start the process:
Code: Select all
[mariadb@localhost ~]$ sudo systemctl start mariadb
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
[mariadb@localhost ~]$ sudo journalctl -xe
Mar 10 10:35:55 localhost.localdomain mysqld[41857]: 2016-03-10 10:35:55 [ERROR] mysqld: Can't create/write to file '/home/mariadb/tmp/ibpGvyL9' (Errcode: 13 "Permission denied")
Code: Select all
[mariadb@localhost ~]$ ls -lsa
0 drwx------ 4 mariadb mariadb 148 Mar 10 10:27 .
0 drwxr-xr-x. 5 root root 60 Mar 10 10:11 ..
0 drwxr-xr-x 2 mysql mysql 10 Mar 10 10:23 data
0 drwxr-xr-x 2 mysql mysql 10 Mar 10 10:27 tmp
Code: Select all
[mariadb@localhost ~]$ getenforce
Disabled
[mariadb@localhost ~]$ sestatus
SELinux status: disabled
Code: Select all
[mariadb@localhost ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 1.9G 49G 4% /
devtmpfs 65G 0 65G 0% /dev
tmpfs 65G 0 65G 0% /dev/shm
tmpfs 65G 8.9M 65G 1% /run
tmpfs 65G 0 65G 0% /sys/fs/cgroup
/dev/sda2 497M 170M 327M 35% /boot
/dev/mapper/centos-home 9.1T 6.4G 9.1T 1% /home
tmpfs 13G 0 13G 0% /run/user/0
Thanks in advance