简体   繁体   中英

Backup/Restore issue with mysqldump (table with URLs)

I have a MySQL that that primarily has innodb tables. I did back up using mysqldump, phpmyadmin, and by saving the files in /var/lib/mysql.

When I try to restore them now, all the tables are restored except for a table that contains "URLs". 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)

Any idea what did that happen? Is there a chance that mysqldump doesn't work always as expected? Do you think that there is a way for me to restore my "URL" data?

I've recently had trouble using 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):

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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