用mydump对所有数据库进行备份,还原具体案例

来源:互联网 发布:淘宝网店推广方案 编辑:程序博客网 时间:2024/04/30 13:16

现有的测试数据:

对所有数据库做备份:

C:\Users\Administrator>mysqldump -u root -p --all-databases> D:\mysql_bak\201409111654_all_database.bak

Enter password: *******

删除jiaodan_test数据库里t表的数据:

导入文件进行恢复:

C:\Users\Administrator>mysql -u root -p < D:\mysql_bak\201409111654_all_database

.bak

Enter password: *******

C:\Users\Administrator>mysql -u root -p

Enter password: *******

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 55

Server version: 5.5.21 MySQL Community Server (GPL)

 

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

 

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

mysql> use dan_test;

Database changed

mysql> select *

    -> from t;

+------+

| id   |

+------+

|    1 |

|    2 |

+------+

2 rows in set (0.00 sec)

 

mysql> use jiao;

Database changed

mysql> select *

    -> from t;

+------+

| id   |

+------+

|    1 |

+------+

1 row in set (0.00 sec)

 

mysql>

--若想了解怎么用mysqldump备份还原某个数据库具体案例,请参考:http://write.blog.csdn.net/postedit/39207889

 

0 0
原创粉丝点击