标签:alter mys 导出数据库 mct trigger restart mysqld systemctl 备份还原
1、从 MySQL5.7 导出数据库mysqldump --all-databases --triggers --routines --events > db.dump
2、在另一台服务器上导入数据库
systemctl stop mysqld
rm -rf /var/lib/mysql/*
systemctl start mysqld
mysql -u root -p
mysql> SET SQL_LOG_BIN=0;
mysql> ALTER USER root@‘localhost‘ IDENTIFIED BY ‘MySQL5.7‘;
mysql> SET SQL_LOG_BIN=0;
mysql> exit
mysql < db.dump
systemctl restart mysqld
注意:数据库版本要一致
标签:alter mys 导出数据库 mct trigger restart mysqld systemctl 备份还原
原文地址:http://blog.51cto.com/linux10000/2169366