How to Export, Backup Or Dump A MySQL Database



To export a MySQL database into a dump file, simply type the following command syntax in the shell.

mysqldump -u username –ppassword database_name > dump.sql

Replace username, password, database_name and dump.sql as your needs. All data, tables, structures and database of database_name will be backed up into a mentioned file dump.sql.
[alert]Don’t put space after -p and then password[/alert]

[Related posts]

How to Backup Only Data of a MySQL Database
For exporting MySQL database’s only the data, use –no-create-info option. The dump will not re-create the database, tables, fields, and other structures when importing. mysqldump...
How to Export A MySQL Database Structure
If You need to export only the MySQL database’s tables’ structures use –no-data switch. mysqldump -u username -ppassword –no-data database_name > dump.sql...
How to Dump All Databases in MySQL Server
To damp all MySQL databases, use the –all-databases option. mysqldump -u username –p password –all-databases > dump.sql...
How to Dump Several MySQL Databases Into Text File
Use –databases option for exporting several databases. mysqldump -u username -ppassword –databases db_name1 [db_name2 ...] >dump.sql...
How to Backup MySQL Databases
There are two methods to backup MySQL, first method is by copying all files such have extentions *.frm, *.MYD, and *.MYI, and second is by...

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>