Eric Guo's blog.cloud-mes.com

Hoping writing JS, Ruby & Rails and Go article, but fallback to DevOps note

Triditional Mysqldump Based MySQL DB Migration Hints

Permalink

Dump based on the SQL not fast, but many system doesn’t need either, and the simplicity many times shining instead of faster.

Dump the DB out

mysqldump -u root -p --all-databases | gzip > thape_bidb_all.sql.gz # input password

It’s the slowest part, so maybe Ctrl+Z and bg and disown -h %1 and having a good sleep.

Transfer DB

scp thape_bidb_all.sql.gz target_server:.

Import DB

unzip thape_bidb_all.sql.gz
mysql -u root -p
source thape_bidb_all.sql
\q

Make analyze and optimize

mysqlcheck -u root -p --auto-repair --optimize --all-databases

Oritinal source

Comments