现有的测试数据:
对所有数据库做备份:
C:\Users\Administrator>mysqldump -u root -p --all-databases> D:\mysql_bak\201409111654_all_database.bak
Enter password: *******
删除jiao和dan_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