MySQL 8.4 · Backup and restore

Back up a database

Write a SQL dump of one database. --single-transaction gives a consistent snapshot of InnoDB tables without locking them.

mysqldump -u root -p --single-transaction --routines mydb > mydb.sql

Official MySQL 8.4 documentation

More backup and restore commands

All backup and restore commands · MySQL 8.4 cheatsheet

Was this page helpful?