Restore original data saved as "???????" from mysql database

When saving the information in the database field, the settings were as follows:

character set: latin1 collation: latin1_swedish_ci 

As soon as users updated the information, I noticed that many of the data was saved as "???????????????????????????????" (Question marks) to the database. Information in English (language) was saved without question. All other languages ​​were saved with question marks.

Now I changed the character set to utf8 and all languages ​​were saved correctly.

The problem is that I need to recover information that is stored as question marks. eg: "????????????????????????????????????"

XAMPP Version: 5.6.19
Version Navicat 11.0.17

Database server
Server version: 10.1.10-MariaDB - binary distribution of mariadb.org

Web server
Apache / 2.4.17 (Win32) OpenSSL / 1.0.2d PHP / 5.6.19 PHP Version: 5.6.19

PHPMYADMIN
Version Information: 4.5.1

Please help me get the source data.

+5
source share
3 answers

MySQL replaced these characters with question marks when they were inserted into the database. The original data is lost forever - there is no way to restore it.

0
source

Check your php / apache / codeigniter logs to insert / update the database - maybe you will find the source data that was inserted there.

0
source

This was due to a database mapping. In this particular case, it is latin1_swedish_ci .

Sorting, in fact, is a set of characters that can be used in table fields in a database. If you try to use a character that is not in the character set of this mapping, MySQL replaces it with a question mark, because it does not know what that character is.

Having said that, there is no way to get the data back. The only way is to scan multiple application or MySQL logs (if any).

0
source

Source: https://habr.com/ru/post/1270770/


All Articles