The mysqldump command is used to produce a “.sql” file that contains a set of SQL statements. This file can be executed to reproduce the original database table data and object definitions. The mysqldump command can be used to backup one or more MySQL databases. The database can be transferred to a new database server using this process.
mysqldump -u root -p -x -A > /volume1/web/mysqldump/yyyyMMddHHmmss-DatabaseName.sql
Command Flag Description:
--lock-all-tables, -x
--all-databases, -A
--password[=password], -p[password]
--user=user_name, -u user_name
Additional References:
- 4.5.4 mysqldump — A Database Backup Program
- mysqldump(1) – Linux man page