Create and restore MySQL backups

July 15, 2024

With the mysqldump command you can create sql database backup file.

mysqldump -u username -p database_name > path\to\your\backup.sql

Once you have a sql file you can restore with the following command.

mysql -u username -p database_name < path\to\your\backup.sql

Maybe you need to navigate to the MySQL installation path to run this commands.

cd C:\Program Files\MySQL\MySQL Server 8.0\bin