Mysql accidentally changed the code of a field, resulting in all the stored Chinese garbled, and then want to change it back to utf-8 and found that it can not be changed back. Is there any way to get the data right?

clipboard.png

Mar.21,2022

Old data is ready, but there is hardly any. If you open the log, you can see if the log is normal and import it. Cool without opening


does not post your specific operation. I don't know how you modified the field code. If you reset the CHARSET, of a field with ALTER TABLE , for example:

ALTER TABLE `table` CHANGE `column` VARCHAR(255) CHARACTER SET latin1;

and then change it back to utf8, then the data must be lost (this is because when converting between different encodings, if you encounter bytes that fail to convert, you will use similar? Or cancel instead, so that when you convert it back, it will not be the original byte)

if you only use SET NAMES latin1 to change the database code or modify the encoding-related constants (for example: character_set_results ), at this time, although you may query the garbled code, you can recover it through SET NAMES utf8 .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b4021b-4db88.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b4021b-4db88.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?