使用mysqldump:
备份
mysqldump -u databasename -p -h localhost databasename>d:demo.sql
还原
mysql -h localhost -u root -p123456 databasename<d:demo.sql
开启mysql的root用户远程访问权限:
use mysql;
update user set host = ‘%’ where user = ‘root’;
FLUSH PRIVILEGES;
使用mysqldump:
备份
mysqldump -u databasename -p -h localhost databasename>d:demo.sql
还原
mysql -h localhost -u root -p123456 databasename<d:demo.sql
开启mysql的root用户远程访问权限:
use mysql;
update user set host = ‘%’ where user = ‘root’;
FLUSH PRIVILEGES;