Skip to content
shellhacks.dev

mysqldump and pg_dump Command Builder

Build safe backup and restore commands for MySQL with mysqldump or PostgreSQL with pg_dump, with compression, retention and a cron schedule.

Free · No sign-up · Your inputs stay in your browser

Input

Build mysqldump and pg_dump commands

Output

Commands

616 characters

--single-transaction gives a consistent snapshot of InnoDB tables without locking them, and --quick streams rows instead of buffering each table in memory. pg_dump's --compress=zstd needs PostgreSQL 16 or later. A backup is only real once a restore of it has been tested.

Runs in this browser. Nothing you paste is sent to a server.

The flags that matter

For InnoDB, --single-transaction takes a consistent snapshot without locking tables and --quick streams rows instead of buffering whole tables in memory; --routines --triggers --events include stored code that is otherwise skipped. For PostgreSQL, the custom format (-Fc) is compressed and lets pg_restore run in parallel and restore single tables. See the pg_dump reference.

Credentials and testing

Passwords on the command line show up in the process list and shell history; use ~/.my.cnf or ~/.pgpass with mode 600. A backup is only proven by a restore: restore into a scratch database on a schedule, and alert if it fails.

Share

Frequently asked questions

How do I back up a large MySQL database without locking it?
mysqldump --single-transaction --quick works for InnoDB tables without locks. For hundreds of gigabytes, a physical backup such as Percona XtraBackup or MySQL Enterprise Backup is much faster to restore.
How do I restore a single table from a pg_dump backup?
With a custom-format dump: pg_restore -d dbname -t tablename backup.dump. Plain SQL dumps cannot be restored selectively without editing the file.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Go deeper

Suggested reading

Keep planning

Similar tools