Import of 8GB mysql dump takes a long time

后端 未结 2 1873
孤街浪徒
孤街浪徒 2021-02-13 17:03

I\'ve got an 8GB MYSQL database dump of InnoDB tables created with mysqldump. I import the data with:

mysql -uroot -p my_db < dump.sql

An 5

2条回答
  •  有刺的猬
    2021-02-13 17:15

    The trick really, is to ensure that the biggest single table fits in the innodb buffer pool. If it does not, then inserts (and import of course) will be extremely slow.

    It doesn't matter the size of the whole database, but the biggest single table.

    For significantly larger databases, you might want to consider alternative methods of transfering the database, such as filesystem snapshots. This of course works best if your machines are running the same version of the database, OS and architecture.

提交回复
热议问题