-
mkdir /disk/mysql
-
/etc/my.cnf中的/var/lib/mysql 换成/disk/mysql
-
/etc/init.d/mysqld 中的/var/lib/mysql 换成/disk/mysql
-
/usr/bin/mysqld_safe中的/var/lib/mysql换成/disk/mysql
-
setenforce 0
-
如果要外部访问,/etc/sysconfig/iptables中添加相应的端口
-
mysql_install_db --user=mysql --datadir=/disk/mysql/
-
chown -R mysql:mysql /disk/mysql
设置远程访问
-
GRANT all privileges ON *.* TO 'name'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
-
GRANT all privileges ON *.* TO 'name'@'machineName' IDENTIFIED BY 'password' WITH GRANT OPTION;