N
N
Nikita Danilov2018-03-27 23:21:35
MySQL
Nikita Danilov, 2018-03-27 23:21:35

How to split a large dump file for MySQL import?

Colleagues, good afternoon!
Faced the following problem:
When importing MySQL large dumps to the server (~5 GB), the import process hangs and does not return any result. After examining the files with a Hex editor, I came to the conclusion that the content is one big INSERT INTO *** VALUES()
Question. How to break a given INSERT programmatically to successfully import a dump.
PS I also tried utilities:
MySQLDumpSplitter.jar - gives an error
https://sqldumpsplitter.net - row limit (134 million)
Thanks in advance!
Best regards,
Nikita

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2018-03-28
Hrebet @hrebet

I recommend The MySQL Command-Line Tool , for example:

mysql -u username -p -h localhost DATA-BASE-NAME < data.sql

D
Denis, 2018-03-29
@sidni

Well, under Windows (you can run under Vine in Linux) there is a program client
https://www.heidisql.com
When loading huge dumps, it tries to repartition inserts on the fly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question