恢复数据库并且 Unicode 字符已转换为垃圾
我每天都会对论坛数据库进行定期备份。今天我不得不将论坛恢复到较早的备份。
我用来备份数据库的命令:
mysqldump --opt -hMY_HOST -uUSERNAME -pPASSWORD DATABASE_NAME 2> error.txt | gzip > DATABASE_NAME_2010_11_06_14_38.gz 2> error.txt
我使用 phpMyAdmin 导入数据库。
在我恢复论坛后,所有 Unicode 字符都转换为垃圾。 示例: http://www.everydayfiction.com/ forums/index.php/topic,2376.msg11198.html#msg11198
如何将这些垃圾字符转换回 Unicode 版本或等效的 ASCII 版本?
导出或导入备份文件时我做错了什么?
I have been making regulate backups of my forums database each and every day. Today I had to revert the forums to an earlier backup.
Command I use to backup my databases:
mysqldump --opt -hMY_HOST -uUSERNAME -pPASSWORD DATABASE_NAME 2> error.txt | gzip > DATABASE_NAME_2010_11_06_14_38.gz 2> error.txt
I used phpMyAdmin to import the database.
After I reverted the forums all the Unicode chars where converted to Garbage.
Example: http://www.everydayfiction.com/forums/index.php/topic,2376.msg11198.html#msg11198
How do I convert these garbage chars back in to there Unicode version or an equivalent ASCII version?
What did I do wrong when exporting or importing the Backup file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可能根本没有做错什么; mysqldump 有一个错误,可以对 utf8 数据进行双重编码。逐字节检查转储文件 - 看起来是这样吗?
You possibly did nothing wrong at all; mysqldump has a bug where it can doubly-encode utf8 data. Check the dump file byte-by-byte - does it look like this is what's happened?