Import a large sql file (> 20 GB)

I am trying to import a very large .sql file into my database. The file is currently 20 GB. I tried using the mysql database <backup.sql console, but this takes longer than 24 hours and the mysql server no longer responded.

How to import such a large file? I think splitting is the way to go, but how can I break it right? This is just one table with a few insert instructions.

+5
source share
4 answers

MySQL has built-in api table inserts built into the language. See below. Use this: http://dev.mysql.com/doc/refman/5.1/en/load-data.html

- csv , , , " , , , , , .. ..".

+1

, (.frm,.MYI,.MYD).
, .

myisam. innodb.

0

sql .

sqldump - sqldumpsplitter ,

split -l 5000 ./path/to/mysqldump.sql ./mysqldump/dbpart-

5000 - sql, . - . , .

, , .

0

SQL- :

  • SQL ,
  • SQL- (;) , .

, script, SQL- , , (;), , , 500 .

script , : https://gist.github.com/pratikone/0a8d503ffe893b2111f5a1d70d3999b7

(;) , , SQL- (;) , . , , .

0

All Articles