#

MySql backup with import & export

Kurz notiert:
Create a mysql-dump which can be easily imported again:

mysqldump -f --add-drop-table --user=MYSQL_USERNAME 
  --password=MYSQL_PASSWORD DATABASE-NAME >DATABASE-DUMP.sql 

Additional gzip-compression:

mysqldump -f --add-drop-table --user=MYSQL_USERNAME 
  --password=MYSQL_PASSWORD DATABASE-NAME | gzip --best > DATABASE-DUMP.sql.gz 

Load a dump back into a database:

mysql -u MYSQL_USERNAME --password=MYSQL_PASSWORD 
  -D DATABASE_NAME < DATABASE-DUMP.sql 
Tags:, , , , , ,

Leave a Reply »»

Note: All comments are manually approved to avoid spam. So if your comment doesn't appear immediately, that's ok. Have patience, it can take some days until I have the time to approve my comments.