D
D
Dos2020-07-10 12:58:16
linux
Dos, 2020-07-10 12:58:16

It takes a long time to dump the MYSQL database. Why?

Hello! There is a mysql database with a size of 670 mb. Installed on Ubuntu 18. There was a move to a new server and the dump began to load for a long time. Here is the view from the console https://cloud.mail.ru/public/3hPj/3neoXmPjV

Running the command Mysql -v -u root -p main_data < /tmp/dump....sql

What could be wrong? How to speed up?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
kocherman, 2020-07-10
@pro-dev

Don't create indexes before adding data.
A typical database dump consists of two sections:
1. database structure
2. database data
Tables are created in the database structure: their fields and indexes.
You need to cut out the code for these indexes and add index creation to the end of the dump.
Then the dump import speed will increase by 50 times.
The type of tables also affects the speed of work - myisam works faster than innodb.

A
Alexey Tsarapkin, 2020-07-10
@Dreamka

670 mb should not be uploaded quickly =)

E
edo1h, 2020-07-13
@edo1h

it's faster to transfer the database directory to rsincom or mariabackup (if you have mariadb)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question