Freitag, 15. März 2013

I don't always dump mysql databases ...

... but when I do, I use commandline tools instead of phpmyadmin - it's much faster and you don't get in trouble with large databases and php filelimits. Today I had to clone some mysql databases from one linux server to another. This happens every few months and I always forget the exact mysqldump commands - so I will note them down here.

Export database

mysqldump -u db_user -pPasswordWithoutBlank --databases db_name --result-file=dbname.sql

Import database

mysql -u db_user -pPasswordWithoutBlank db_name < dbname.sql
Thanks to this post by Ramesh Natarajan which is always my favorite google result on this topic.

Keine Kommentare:

Kommentar veröffentlichen