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
8. you may have to change database related software (like zabbix using mysql) configuration file to the correct socket (/new/mysql/mysql.sock)
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)
相关文章推荐
- Instruction’s to Change Default MySQL Data Directory:
- mac os Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql'
- mysql 5.7.21 CMake Error: The source directory "/data/server/mysql" does not appear to contain CMak
- Change mysql default data location
- MySQL Change Data Directory
- 启动mysql 失败,“Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' ”
- linux中ERROR: The partition with /var/lib/mysql is too full!解决办法
- 解决mysql 添加插件时提示 ERROR 1289 (HY000): The ‘plugin’ feature is disabled; you need MySQL built with ‘HAVE_DLOPEN&#
- Install Mysql with SELinux on
- #1289 - The 'InnoDB' feature is disabled; you need MySQL built with 'InnoDB' to hav
- The ‘InnoDB’ feature is disabled; you need MySQL built with ‘InnoDB’ to have it working
- MySQL恢复数据报错 #1289 - The 'InnoDB' feature is disabled; you need MySQL built with 'InnoDB' to hav
- 解决Navicat数据传输问题:The‘InnoDB’feature is disabled; you need MySQL built with ‘InnoDB'...
- mysql --initialize specified but the data directory has files in it
- mysql无法开启:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql'
- 解决 The 'InnoDB' feature is disabled; you need MySQL built with 'InnoDB' to have it working
- MYSQL-执行“load data local infile”报错“The used command is not allowed with this MySQL version”
- how to change the default mode of a linux device
- Linux 启动mysql报错: ERROR: The partition with /var/lib/mysql is too full! failed!
- mysql无法开启:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql'