码迷,mamicode.com
首页 > 数据库 > 详细

mysql数据库数据备份与恢复

时间:2017-05-07 14:52:00      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:server   enter   file   class   loading   load   war   select   rom   

备份数据:

C:\Users\Administrator>mysqldump -uroot --password -v test01 test02 >e:\temp\20170507\a3.sql
Enter password: ****
-- Connecting to localhost...
-- Retrieving table structure for table test02...
-- Sending SELECT query...
-- Retrieving rows...
-- Disconnecting from localhost...
mysql> use test01;
Database changed
mysql> select * from test02 into outfile e:\temp\20170507\a5.sql
    -> ;
ERROR 1 (HY000): Cant create/write to file e: emp20170507a5.sql (Errcode: 2 -
 No such file or directory)
mysql> select * from test02 into outfile e:/temp/20170507/a5.sql;
Query OK, 8 rows affected (0.00 sec)

 恢复数据:

使用load data方法

mysql> load data infile e:/temp/20170507/a5.sql into table test03;
Query OK, 8 rows affected (0.03 sec)
Records: 8  Deleted: 0  Skipped: 0  Warnings: 0

使用mysqlimport方法

C:\Users\Administrator>mysqlimport --user root --password -v test01 e:/temp/2017
0507/test03.sql
Enter password: ****
Connecting to localhost
Selecting database test01
Loading data from SERVER file: e:/temp/20170507/test03.sql into test03
test01.test03: Records: 8  Deleted: 0  Skipped: 0  Warnings: 0
Disconnecting from localhost

 

mysql数据库数据备份与恢复

标签:server   enter   file   class   loading   load   war   select   rom   

原文地址:http://www.cnblogs.com/weiweictgu/p/6820622.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!