How to migrate data to mysql?
How to migrate data to mysql? I believe that many novice rookies have not yet learned this skill, through the summary of this article, I hope you can learn mysql data migration. The following information is about the steps of mysql data migration.
1 suspension of service
/ etc/init.d/mysqld stop
Ls / var/lib/mysql/
2 change the configuration
Vi / etc/my.cnf
Datadir=/data/mysql
3 move data
Rsync-a / var/lib/mysql / data
Hown-R mysql:mysql / data
4 start
/ etc/init.d/mysqld start
# Startup failure error report is as follows
200303 10:37:11 mysqld_safe Starting mysqld daemon with databases from / data/mysql
200303 10:37:11 [Warning] Can't create test file / data/mysql/logserver2.lower-test
200303 10:37:11 [Warning] Can't create test file / data/mysql/logserver2.lower-test
/ usr/libexec/mysqld: Can't change dir to'/ data/mysql/' (Errcode: 13)
200303 10:37:11 [ERROR] Aborting
200303 10:37:11 [Note] / usr/libexec/mysqld: Shutdown complete
200303 10:37:11 mysqld_safe mysqld from pid file / var/run/mysqld/mysqld.pid ended
Change the selinux configuration to return to normal
Getenforce
Setenforce 0
Vi / etc/selinux/config
The above are the steps of mysql data migration, and the detailed usage needs to be used by yourself. If you want to know more about it, welcome to follow the industry information channel!