http://blog.csdn.net/fdipzone/article/details/9709443
在shell命令行下执行 下边语句
1.导出数据
[plain] view plain copy
- // 导出test 数据库 -R 表示导出函数和存储过程,加上使导出更完整
- mysqldump -u root -p -R test > test.sql
- // 导出test数据库中user表
- mysqldump -u root -p test user > test_user.sql
2.导入数据
[plain] view plain copy
- 方法1:
- mysql -u root -p
- mysql>use test
- mysql>source test.sql
- 方法2:
- mysql -u root -p test < test.sql