Posted by
admin on Sep 16, 2011 in
Databases,
MySQL |
0 comments
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 DatabaseFor 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 StructureIf 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 ServerTo 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 FileUse –databases option for exporting several databases. mysqldump -u username -ppassword –databases db_name1 [db_name2 ...] >dump.sql...
How to Backup MySQL DatabasesThere are two methods to backup MySQL, first method is by copying all files such have extentions *.frm, *.MYD, and *.MYI, and second is by...