Importing database very slow

492 views Asked by At

I am setting up a new environment and I want to migrate the database. In order to do that, I am doing a dump from my current db and trying to import the dump to the appcloud mariadb server. That's the dump creation command:

mysqldump --extended-insert=FALSE --skip-add-locks --skip-lock-tables --no-autocommit --protocol=TCP -P 13000 --user=XXX --password=XXX xxx > "dump.sql"

I need to make single insert queries because some of the lines are too long and produce errors. In order to import it use the following command:

mysql --init-command="SET AUTOCOMMIT = 0;" --protocol TCP --port 13000  --host=127.0.0.1 --user=XXX --password=XXX --show-warnings xxx < dump.sql

I get this error pretty soon: ERROR 2006 (HY000) at line 3805: MySQL server has gone away

The dump is 1.2G so I have tried to split by table and making smaller files. It takes really long time and I still, for some of the files, get the error mentioned previously.

This process is really long and tedious. Is there any other way to accelerate this import? Any other process is more convenient for large dump files? At the moment, even with a not fully successful migration, it takes 2 days to push all data.

0

There are 0 answers