Can't create/write to file '/d/data/myhost.err' (Errcode: 13 "Permission denied")
I am installing MariaDB 10.1.21 on RHEL 6.7.
I am experiencing an issue when starting mysql service (/etc/init.d/mysql) from a custom datadir. So as you can see that my datadir is /d/data/, i put that info in /d/data/my.cnf:
basedir = '/usr'
datadir = '/d/data'
tmpdir = '/tmp'
When starting using /etc/init.d/mysql:
service mysql start
Starting MySQL. [FAILED]
And it logged nothing into the log file /d/data/<hostname>.err
So I digged into the /etc/init.d/mysql script and echoed the command when starting mysqld_safe:
/usr/bin/mysqld_safe --defaults-file=/d/data/my.cnf --datadir=/d/data --pid-file=/d/data/myhost.pid
170308 05:37:58 mysqld_safe Logging to '/d/data/myhost.err'.
170308 05:37:58 mysqld_safe Starting mysqld daemon with databases from /d/data
/usr/bin/mysqld_safe_helper: Can't create/write to file '/d/data/myhost.err' (Errcode: 13 "Permission denied")
As checked the folder /d/data/ has owner mysql:mysql and permission 755 the file /d/data/myhost.err also has owner mysql:mysql and permission 755
I tried chown and chmod to 777 and the error was still there.
It would be great if anyone knows this issue and help me?
Answer Answered by Ian Gilfillan in this comment.
Take a look at What to Do if MariaDB Doesn't Start as well.