http://blog.csdn.net/fdipzone/article/details/9709443


MySQL 导入导出数据库


1.导出数据

[plain] view plain copy
  1. // 导出test 数据库 -R 表示导出函数和存储过程,加上使导出更完整  
  2. mysqldump -u root -p -R test > test.sql  
  3.   
  4. // 导出test数据库中user表  
  5. mysqldump -u root -p test user > test_user.sql  

2.导入数据
[plain] view plain copy
  1. 方法1:  
  2. mysql -u root -p  
  3. mysql>use test  
  4. mysql>source test.sql  
  5.   
  6. 方法2:  
  7. mysql -u root -p test < test.sql


本文转载:CSDN博客