Export a MySQL database using the command line.

February 2, 2010
By silviu

Sometimes it’s easier to just drop to the command line then browse for fancy tools like phpMyAdmin. This is useful, especially for quick jobs.

mysqldump -u user -ppassword your_database > database_backup.sql

Of course you need to replace:

  • user – mysql username
  • password – the password
  • your_database – the database you want to backup

Adding -h host.domain.com would allow to backup a remote mysql database from YOUR shell, something like this:

mysqldump -u user -h host.domain.com -ppassword your_database > database_backup.sql

Tags: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Website personal

Daca sunteti interesati de activitatea mea personala sau serviciile oferite acesta este site-ul pe care doriti sa-l vizitatiro.sgvulcan.com

Follow me:

Subscribe via RSS Subscribe via Email