MySQL + SELinux: Can't change dir (Errcode: 13)

Posted on in System Administration

Powered By MySQLIf you're using a non-standard MySQL data directory on your Red Hat Enterprise Linux (RHEL) server, you may have seen an error like /usr/libexec/mysqld: Can't change dir to '/mysql_data/' (Errcode: 13). The key to fixing this problem is to ensure the new MySQL data directory has the proper SELinux security context. In my case:

# chcon -R system_u:object_r:mysqld_db_t /mysql_data/

After that, mysqld should start up fine.

My Bookshelf

Reading Now

Other Stuff