Backup MySQL database
Question:
How to backup MySQL database? Answer:
mysqldump -u testuser -p testdb > /tmp/backup.sql
mysqldump -u [MYSQL_USER] -p [DATABASE_NAME] > [OUTPUT_FILE]
Description:
The mysqldump
client utility performs logical backups, producing a set of SQL statements that can be executed to reproduce the original database object definitions and table data. It dumps one or more MySQL databases for backup or transfer to another SQL server. The mysqldump
command can also generate output in CSV, other delimited text, or XML format.
Reference:
mysqldump reference
Share "How to backup MySQL database?"
Related snippets:
- Import an SQL file using the command line in MySQL
- Backup only certain rows from MySQL database
- Create INSERT statement for each record with mysqldump
- Backup MySQL database without locking tables
- Backup MySQL data only
- Skip tables in MySQL backup
- Backup only selected tables in MySQL
- Backup MySQL schema only
- Backup MySQL database
Tags:
mysql backup, mysqldump, backup database, backup mysql database Technical term:
Backup MySQL database