Home >Database >Mysql Tutorial >How to Efficiently Import a Massive MySQL Dump File?

How to Efficiently Import a Massive MySQL Dump File?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-11-04 13:28:02817browse

How to Efficiently Import a Massive MySQL Dump File?

Importing a Massive MySQL Dump into a New Database

Question:

Importing a colossal 14 GB MySQL dump file into a fresh database can be a daunting task. How can it be accomplished efficiently and reliably?

Answer:

To import such a large dump, follow these detailed steps:

  1. Open a MySQL terminal.
  2. Set the network buffer length (net_buffer_length) and maximum allowed packet size (max_allowed_packet) to high values, as follows:
  1. Disable foreign key checking to prevent errors and delays:
  1. Import the dump file using the "source" command:
  1. Re-enable foreign key checks once the import is complete:

Note:

The above solution is sourced from this helpful forum thread.

The above is the detailed content of How to Efficiently Import a Massive MySQL Dump File?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn