简体   繁体   English

mysqldump的备份/还原问题(带有URL的表)

[英]Backup/Restore issue with mysqldump (table with URLs)

I have a MySQL that that primarily has innodb tables. 我有一个主要具有innodb表的MySQL。 I did back up using mysqldump, phpmyadmin, and by saving the files in /var/lib/mysql. 我确实使用mysqldump,phpmyadmin和将文件保存在/ var / lib / mysql中进行了备份。

When I try to restore them now, all the tables are restored except for a table that contains "URLs". 当我尝试立即还原它们时,所有表都将还原,但包含“ URL”的表除外。 The information in that table is not complete. 该表中的信息不完整。 I tried restoring the three types of backup and it's the same. 我尝试还原三种备份类型,这是相同的。 (The URLs are stored using UTF8) (URL使用UTF8存储)

Any idea what did that happen? 知道发生了什么事吗? Is there a chance that mysqldump doesn't work always as expected? mysqldump是否有可能无法始终按预期运行? Do you think that there is a way for me to restore my "URL" data? 您是否认为我可以还原“ URL”数据?

I've recently had trouble using mysqldump. 我最近在使用mysqldump时遇到了麻烦。 My locales and client and server and table charsets and everything that could posibly be set to use utf8 charset was set to use it and still I was getting rubbled ASCII output on mysqldump, which lead to errors when importing because of all the ??·$^"·???. mojibake input. My solution (hope it works for you): 我的语言环境,客户端,服务器和表字符集以及所有可能设置为使用utf8字符集的设置都使用了它,但我仍然在mysqldump上出现乱码的ASCII输出,由于所有??·$,导致导入时出错^“·???。mojibake输入。我的解决方案(希望它对您有用):

export: 出口:

mysqldump -u USER -pPASS -r db.sql db

import: 进口:

mysql -u USER -pPASS db
MYSQL [db]>SOURCE db.sql

Also solutions like percona xtrabackup may seem overkill at first glance, but this in particular at least works really good and the basic usage is really simple, the tool is GPL licensed and you don't need to worry about non exact replications, because it copies the binary database files as they are without generating commands that are supposed to make a database like yours but then they won't... 乍看之下,诸如percona xtrabackup之类的解决方案似乎也有些过分 ,但这至少特别有效,并且基本用法非常简单,该工具已获得GPL许可,您无需担心非精确复制,因为它可以复制二进制数据库文件照原样运行,而没有生成应该像您的数据库那样创建数据库的命令,但是它们不会...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM