↑ ↓ select, Enter open, Esc close

Back up all databases into one gzipped file

Adjust the values, the command updates live
root@server
mysqldump --single-transaction --quick --all-databases --routines --events | gzip > /root/all-databases.sql.gz

Writes all databases, including user tables, stored procedures and events, into a single compressed dump. As root on Debian, login works over the Unix socket without a password. Suitable as a full backup before MariaDB upgrades.

Note: On Plesk servers, log in as admin instead (see .psa.shadow). For restoring individual databases, one dump per database is more practical.

Also searched as

  • backup all mysql databases
  • full database dump
  • mariadb full backup

Related one-liners

All in MySQL and MariaDB

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.