D
D
Dmitry Tarasov2017-07-10 12:25:15
MySQL
Dmitry Tarasov, 2017-07-10 12:25:15

How to convert database file and mysql data from CP1251 to UTF-8?

How to convert database file and mysql data from CP1251 to UTF-8 ?
Before there was an instruction, according to it did. You go as root, then you dump the database, then dump the converted database, etc.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2017-07-10
@saboteur_kiev

Under Linux, you can convert a text dump of the database
iconv -f CP1251 -t UTF-8 dump.original -o dump_converted
Then upload it back to the database, but the encoding of the tables / database itself must also be changed to utf-8.

S
Swartalf, 2017-07-10
@Swartalf

https://dev.mysql.com/doc/refman/5.7/en/alter-table...
Changing the Character Set
To change the table default character set and all character columns (CHAR, VARCHAR, TEXT) to a new character set, use a statement like this:
ALTER TABLE tbl_name CONVERT TO CHARACTER SET charset_name;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question