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:
- Open a MySQL terminal.
- Set the network buffer length (net_buffer_length) and maximum allowed packet size (max_allowed_packet) to high values, as follows:
- Disable foreign key checking to prevent errors and delays:
- Import the dump file using the "source" command:
- 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