Backup a specific table redirecting the output to a file (user will be prompted for a password)

mysqldump

  • Backups MySQL databases.
    See also `mysql` for restoring databases.
    More information: <https://dev.mysql.com/doc/refman/en/mysqldump.html>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

mysqldump --user {{user}} --password {{database_name}} {{table_name}} > {{path/to/file.sql}}

click the source code to copy install mysqldump on any operating system with command-not-found.com