您的位置:首页 > 运维架构 > Linux

Change the default MySQL data directory with SELinux disabled

2014-01-05 14:54 405 查看
Linux platform: CentOS 6.5 x86_64 with mysql 5.1

1. service mysqld stop

2. mkdir -p /new/mysql (or anywhere you want to)

3. chown -R mysql.mysql /new/mysql

4. mv /var/lib/mysql/* /new/mysql/

5. vi /etc/my.cnf
datadir=/new/mysql
socket=/new/mysql/mysql.sock
[client]
socket = /new/mysql/mysql.sock

6. service mysqld start

7. mysql -uroot
mysql> show databases;


8. you may have to change database related software (like zabbix using mysql) configuration file to the correct socket (/new/mysql/mysql.sock)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐