Karalama Kâğıdı

Compress MysqlDump Output

all databases

mysqldump -u root -p --all-databases > dump.sql

one database

mysqldump -u root -p --databases db1 > dump.sql

many databases

mysqldump -u root -p --databases db1 db2 db... > dump.sql

triggers

mysqldump -u root -p --triggers --all-databases > dump.sql

procedures and functions:

mysqldump -u root -p --routines --all-databases > dump.sql

gzip:

mysqldump -u root -p --all-databases | gzip > dump.sql.gz

bzip2:

mysqldump -u root -p --all-databases | bzip2 > dump.sql.bz2

Making a comparison between the dump with three compression options (none, gzip and bzip2) had the following result:

And how do I restore the dump?

Normal:

mysql -u root -p < dump.sql

gzip:

gunzip < dump.sql.gz | mysql -u root -p

bzip2:

bunzip2 < dump.sql.bz2 | mysql -u root -p

Arama Terimleri:

Exit mobile version