I need some details on importing and exporting a MySQL 8 database.
If the entire database is backed up in one dump, is it possible to restore a single table, or should the individual tables be exported?
When setting FOREIGN_KEY_CHECKS
, UNIQUE_CHECKS
, and AUTOCOMMIT
to 0
, is this done to the database that you are importing to from MySQL? If so, it seems to have no effect for me. If not, please provide the details on how to do these settings.
Should the settings in 2.) be done to the database prior to exporting in order to get faster importing?
This 12 hour import of one table with 5M records and several indexes is for the birds.
CREATE TABLE
and INSERT INTO
ones that you wish to skip. Exporting only portions of a database has the same effect. Sometimes you don't have the choice (either no text editor available dealing with large files, or no source database to export available). What you haven't stated is how you import and with which program: via console and the "mysql" client (ie mysql < data.sql
)? Have you checked the operating system's performance during the import to see a bottleneck (ie high disk usage, much swapping, no more RAM left, CPU usage...)?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.