A
A
Alexey Ostrov2015-05-11 15:21:29
MySQL
Alexey Ostrov, 2015-05-11 15:21:29

How and with what can I convert databases larger than 30GB in mysql with cp1251 to utf8?

There are databases larger than 30GB , it is necessary to convert schemes to utf8 and also convert the data.
Does anyone have any ideas on the best way to do this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vlad Zhivotnev, 2015-05-12
@inkvizitor68sl

If the highload tag is set not from the bullshit (actually, there is no base for 30 GB) and there really is a permanent load that cannot be got rid of, then:
1) if it is possible to switch the base and the service to read-only - switch.
1.1) if not, we write in the application a layer to the mysql-base, which first makes a request to a new database with utf8, then to the old one with cp1251, merging the results.
2) transfer line by line / table by table data to a new database, converting on the fly. We check that the string is in the new database, delete the string from the old database.
If you have highload set from the bulldozer, then dump, iconv, restore to the database with a new name. Extinguish the application before this so that the data is not lost (or transfer it to a read-only database).

V
Vapaamies, 2015-05-11
@vapaamies

Isn't it possible in MySQL itself? Create a table in UTF-8 and use insert as select to overtake the data. The old table can then be deleted, and the new table can be renamed to the name of the old one, if necessary.
After the distillation of all tables, change the default base encoding to UTF-8. You can even up to, I think, since the encoding is stored separately in each table.

D
Dmitry Luponos, 2015-05-11
@Bessome

iconv on linux successfully transcodes. However, I will support Vapaamies , it is better to unload from MySQL in the desired encoding (it is set for tables there).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question