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
, andAUTOCOMMIT
to0
, 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
andINSERT 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 (i.e.
mysql < data.sql
)? Have you checked the operating system's performance during the import to see a bottleneck (i.e. high disk usage, much swapping, no more RAM left, CPU usage...)?