For example, I have a discuz forum website with a database named Discuz
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| Discuz |
| MySQL |
| Test |
+--------------------+
4 rows in Set (0.00 sec)
mysql> use Discuz;
Reading table information for completion of table and column names
Can turn off this feature to get a quicker startup with-a
Database changed
I sent a post, just at the beginning can be normal browsing, if I delete the Post table, will report the following error:
discuz! Database Error
(1146) Table ' discuz.forum_post ' doesn ' t exist
Mysql> Show tables like "Pre_%_post";
+-------------------------------+
| Tables_in_discuz (Pre_%_post) |
+-------------------------------+
| Pre_forum_debatepost |
| Pre_forum_filter_post |
| Pre_forum_post |
| Pre_security_evilpost |
+-------------------------------+
4 rows in Set (0.00 sec)
Mysql> drop table pre_forum_post;//can also drop table discuz.pre_forum_post directly;
Query OK, 0 rows Affected (0.00 sec)
If I had backed up with the mysqldump command before the deletion, I could have returned it if I had deleted the data by mistake.
# mysqldump-uroot-p discuz > discuz.sql;//Backup Library
# Mysql-uroot-p Discuz < discuz.sql;//Recovery Library
# mysqldump-uroot-p Discuz pre_forum_post > pre_forum_post.sql;//Backup table
# mysql-uroot-p Discuz < pre_forum_post.sql;//Restore the table, the first half of the same as the Restore library commands, the latter part selects the backed up table SQL on the line
# mysqldump-uroot-p--DEFAULT-CHARACTER-SET=GBK discuz pre_forum_post > pre_forum_post_gbk.sql;//specifying a Character Set backup table
# mysql-uroot-p--DEFAULT-CHARACTER-SET=GBK Discuz < pre_forum_post_gbk.sql;//Specify the character Set recovery table, the first half of the same as the Restore Library command, The second half selects the backed up table SQL on the line
MySQL Backup restore