0

I am trying to restore a large dump (~300GB MyISAM) into a Mysql server version 5.6.48, but if using:

mysql < file.sql

or

mysql> source file.sql

In both cases, after starting the process all memory RAM/SWAP gets used, looks like the memory is not released, or is trying to read all input into memory.

Any idea of how to import/restore the file without consuming all system memory?

What currently I am doing as an ugly solution, is to import by chunks but restarting the server to free memory after every import, something like:

for t in chunks_*
mysql db_name < $t && service mysql-server restart && sleep 2   

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.