-
Notifications
You must be signed in to change notification settings - Fork 6
Archive & Restore Project DBs
Robert Gifford edited this page Jul 12, 2024
·
4 revisions
Database dump files can be generated using the mysqldump
program (part of the MySQL distribution). For example:
mysqldump -u [user] -p [database_name] > dumpfilename.sql
To restore a database, use the following command:
mysql -u [user] -p [database_name] < dumpfilename.sql
Note: Make sure you create the database before running the restore command. You can create a database with:
mysql -u [user] -p -e "CREATE DATABASE [database_name];"
Replace [database_name] with the name of your database and dumpfilename.sql with the name of your dump file.