V
V
Valery Sotnikov2014-10-23 21:51:46
MySQL
Valery Sotnikov, 2014-10-23 21:51:46

How to export in utf8 encoding from a large MySQL database using mysqldump?

Dump over 1GB, many graphic systems crash =)
Here is from the exported database:
mysql> SHOW VARIABLES LIKE "char%";

+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     |
| character_set_connection | latin1                     |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | latin1                     |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+

I tried with the command:
mysqldump -uuser -ppass mydb > dumpdb
I received a dump in SQL format, but all Russian characters are displayed with question marks "?", do not offer a decoder, it will not help.
[email protected] ~ # mysqldump --version
mysqldump  Ver 10.13 Distrib 5.1.70, for pc-linux-gnu (x86_64)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Valery Sotnikov, 2014-10-24
@web_user

Here is the solution:
Got everything in UTF-8 by trial and error. Uff, wow! =)
--single-transaction - must be added for InnoDB tables ( from habr and about -e it is also written there).
-r - this is more correct than output to a file through ">" read in English. resource, but I don’t remember where, something related to encodings.
Everything else is used as is)

A
Andrey Ezhgurov, 2014-10-23
@eandr_67

Take any MySQl management system - from PhpMyAdmin to dbForge Studio for MySQL - and dump it.
And if you have triggers in the database, then dbForge Studio will create a dump that will be completely safe from this side (no data damage from triggers that worked during recovery).

A
Alex, 2014-10-24
@shoomyst

From graphic I advise you to try Sypex Dumper.
I have no idea how it works, but I'm always amazed how a web application can handle such volumes of data, where the same SQLYog hangs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question