标签:mysql 迁移
mysql 5.6 RPM安装时,目录默认放在 /var/lib/mysql, 要迁移到新目录/mysqldata,
1.cp -arp/var/lib/mysql/* /mysqldata/
2. chown mysql.mysql/mysqldata
3.这是比较简单的/etc/my.cnf,mysql 5.6 已经与先前的参数不怎么一样
[client]
default-character-set=gbk
port = 3306
socket = /mysqldata/mysql.sock
[mysqld]
#event_scheduler=ON
character_set_server=gbk
skip-name-resolve
lower_case_table_names=1
user = mysql
#log-bin = mysql-bin
server-id = 1
datadir=/mysqldata
basedir=/usr
tmpdir=/mysqldata
port = 3306
socket = /mysqldata/mysql.sock
skip-external-locking
4.重启mysql就可以了。
标签:mysql 迁移
原文地址:http://yexiang.blog.51cto.com/482178/1612034