mysql 导入导出数据库

mysql 导入导出数据库


1.导出数据

// 导出test 数据库
mysqldump -u root -p test > test.sql

// 导出test数据库中user表
mysqldump -u root -p test user > test_user.sql

2.导入数据
方法1:
mysql -u root -p
mysql>use test
mysql>source test.sql

方法2:
mysql -u root -p test < test.sql


原文地址:https://www.cnblogs.com/fdipzone/p/3715097.html