mysql 导入导出数据库

来源:互联网 发布:图片缩小软件 编辑:程序博客网 时间:2024/06/07 05:15

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

原创粉丝点击