1. Backup and Backup Discuz Library
[[email protected] ~]# mysqldump-uroot-p654321 discuz > /data/discuz_sql.bak//backup Discuz Library
[[email protected] ~]# mysql-uroot-p654321 discuz < /data/discuz_sql.bak//Recovery Discuz Library
2. Back up and restore the Pre_forum_post table in the Discuz library
[Email protected] ~]# mysqldump-uroot-p654321 discuz pre_forum_post >/data/discuz_post.bak
[[email protected] ~]# mysql-uroot-p654321 Discuz </data/discuz_post.bak//restore without table name
3. Specify the character set when backing up and restoring
Sometimes there is a problem with the character set of the backup file when it comes to recovery, then we need to specify the character set (Gbk,utf8, etc.)
[Email protected] ~]# mysqldump-uroot --default-character-set=gbk -p654321 discuz pre_forum_post >/data/ Discuz_post.bak
[Email protected] ~]# mysql-uroot --default-character-set=gbk -p654321 discuz </data/discuz_post.bak
MySQL Backup and recovery