Forrest logo
back to context overview

mysqldump

List of commands for mysqldump:

  • 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
    explain this command
  • mysqldump:ai:87ee7 backup all mysql databases into one file
    $ mysqldump -u ${username} -p ${password} --all-databases > backup.sql
    try on your machine
    explain this command
  • mysqldump:backup:with-password Create a backup (user will be prompted for a password).
    $ mysqldump --user ${user} --password ${database_name} --result-file=${filename-sql}
    try on your machine
    explain this command
  • mysqldump:tldr:15c71 mysqldump: Backup all databases from a remote host, redirecting the output to a file (user will be prompted for a password).
    $ mysqldump --host=${ip_or_hostname} --user ${user} --password --all-databases > ${filename-sql}
    try on your machine
    explain this command
  • mysqldump:tldr:71d28 mysqldump: Backup a specific table redirecting the output to a file (user will be prompted for a password).
    $ mysqldump --user ${user} --password ${database_name} ${table_name} > ${filename-sql}
    try on your machine
    explain this command
  • mysqldump:tldr:d144e mysqldump: Backup all databases redirecting the output to a file (user will be prompted for a password).
    $ mysqldump --user ${user} --password --all-databases > ${filename-sql}
    try on your machine
    explain this command
back to context overview