![](http://upload.wikimedia.org/wikipedia/en/thumb/6/62/MySQL.svg/489px- MySQL.svg.png)
This evening, I chose to install MySQL 5.5 instead of accepting the 5.1 version that _place_holder;shipped with my CentOS 6  _place_holder;Linux distribution.  _place_holder;After dutifully downloading the binaries and successfully installing the RPMs, I received the following error message when starting mysqld:
 _place_holder;
Starting MySQL. ERROR! The server quit without updating PID file (/data01/mysql/localhost.pid).
As it turns out, there is an active SELinux policy for MySQL.  _place_holder;The default policy expects /var/lib/mysql to be used instead of my desired /data01/mysql logical volume. _place_holder;
After a few minutes of reviewing the SELinux documentation, the following commands were necessary to update the policy to use the desired MySQL data directory.
# semanage fcontext -a -t mysqld_db_t "/data01/mysql(/.^)?"
# restorecon -Rv /data01/mysql
If you don’t have the policycore utilities installed, you may not have the SELinux management tools.  _place_holder;To install those on CentOS 6/RHEL6:
# yum install policycoreutils policycoreutils-python
I could have opted to disable or stop enforcement of SELinux all together.  _place_holder;I find value in it and prefer to try and make it work. I have to admit, however, there there are times that I just disable it to help simplify and application configuration or troubleshooting.  _place_holder;Many times, it is the culprit as to why an external package or non-standard configuration does not work.