E
E
Empath2017-09-28 18:00:56
MySQL
Empath, 2017-09-28 18:00:56

How to restore the original encoding of a MySQL dump?

Greetings!
There is a database dump in utf8 format, although the data itself is in cp1251. The file encoding is shown as us-ascii.
If the dump is uploaded to the hosting and then exported via mysqldump with the indication of charset cp1251, as well as when converting utf8> cp1251 via iconv, instead of the letter AND everywhere there are question marks.
The file size is more than 3 GB and cannot be opened in a regular text editor.
Is there a way to restore the encoding, in my case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fortop, 2017-10-01
@Fortop

It is necessary to perform the reverse operations of removing the dump.
Is there a table structure in the dump? Or just data?
If the former, then you need to make sure that the table encoding will be the same as on where it was made from.
If the latter, then you need to create these tables with the original encoding.
After filling the dump, it is already normal to remove it.
This is the easiest way because it saves personal time due to server work.
Alternatively, you can convert the dump to the correct encoding. But for this you will need to take into account all those differences in the set encodings on the server, on the connection, on the source tables

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question