Forrest logo
back to the mysqldump tool

mysqldump:ai:22534

backup mysql database with date in the name
$ mysqldump -u ${username} -p ${password} ${database_name} > /path/to/backup/$(date '+%Y-%m-%d').sql
try on your machine

This command exports the MySQL database specified by [database_name] and creates a backup file with the current date in the filename (e.g., '2021-09-30.sql'). Replace [username], [password], and [database_name] with your MySQL credentials and desired database name. Make sure to specify the correct path for the backup file.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.

Questions that are answered by this command:

  • backup mysql database with date in the name?
back to the mysqldump tool