Pages

Monday, October 27, 2014

Enabling selinux to accept different data directory for mysql.


 
mkdir  /opt/mysql

        cp –R –p /var/lib/mysql   /opt/mysql

        vi  /etc/my.cnf

                        (here changed the mysql default data_dir to /opt/mysql

 #datadir=/var/lib/mysql

datadir=/opt/mysql

/etc/init.d/mysql stop

semanage fcontext -a -t mysqld_db_t "/opt/mysql(/.*)?"

restorecon -R -v /opt/mysql/

/etc/init.d/mysql start

No comments:

Post a Comment