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