When starting mysql on Centos servers with a custom data directory you might get an error similar to the following:
2014-10-15 10:23:56 17081 [Warning] Can't create test file /database/mysql/localhost.lower-test
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
If your chmod and chown settings are already correct you might need to look into selinux.
This page explains how to configure selinux for mysql: https://blogs.oracle.com/jsmyth/entry/selinux_and_mysql
If you tried fixing ownership and permissions.
chown -R mysql:mysql /new-path/mysql chmod 0755 /new-path/mysql
And you do not have SELinux enabled but you still have a problem.
All you need to do is to edit
and undefine those variables (setting it to false won't work)
And reload daemon
After I did this it finally worked. Interesting is that this occurs only with MariaDB 10.1 Those variables are not existent for earlier versions. Recently I have found this bug:
Since this configuration gets overwritten after a MariaDB update, I have found a permanent fix to avoid any further downtime because of this.
cp /usr/lib/systemd/system/mariadb.service /etc/systemd/system/mariadb.service
Then I made changes here instead
That's it :)