原来的存放目录/usr/local/mysql/var
新的目录/var/mysql
1.service mysql stop
2.mkdir /var/mysql
chown -R mysql /var/mysql
chgrp -R mysql /var/mysql
3.vi /etc/my.cnf
add: datadir=/var/mysql
log-bin=/var/mysql/mysql-bin
4.service mysql start