I have large database of 22GB
. I used to take backup with mysqldump
command in a gzip format.
When i extract the gz file it produces the
I've had to deal with the same issue. I've found using mysqldump
to output to a CSV file (like this):
mysqldump -u [username] -p -t -T/path/to/db/directory [database] --fields-enclosed-by=\" --fields-terminated-by=,
and then importing that data using the LOAD DATA INFILE
query from within the mysql client (like this):
LOAD DATA FROM INFILE /path/to/db/directory/table.csv INTO TABLE FIELDS TERMINATED BY ',';
to be about an order of magnitude faster than just executing the SQL queries containing the data. Of course, it's also dependent on the tables being already created (and empty).
You can of course do that as well by exporting and then importing your empty schema first.