Use Mydump to back up all databases to restore specific cases

Source: Internet
Author: User

Existing test data:

Make a backup of all databases:

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

Enter Password: *******

Delete data from the T-table in the Jiao and Dan_test databases:

To import files for recovery:

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), the Oracle and/or its affiliates. All rights reserved.

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

Affiliates. Names may 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>

-If you want to know how to use mysqldump backup to restore a specific case of a database, please refer to: http://write.blog.csdn.net/postedit/39207889

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.