backing up and restoring databases using phpMyAdmin. | ramblings of a sysadmin.

backing up and restoring databases using phpMyAdmin.

i’m very much a command-line-interface kind of girl, but not everyone has shell access. hopefully, they do have phpMyAdmin, one of the most essential tools for managing your database.
the tutorial below gives you an idea of how to perform a database backup and restore using phpMyAdmin.
database backup.
1. open your phpMyAdmin webpage. hopefully, you have a link to it somewhere in your website’s control panel.
2. click on the database name on the left-hand navigational bar (generally in black text, with a number in parentheses indicating the number of tables in the database)
3. click on Export on the top of the screen.
5. check the option next to Save as File
4. hit the Go button.
5. download the *.sql file.
you can open this file in Notepad or any text editor and see the database schema with all of its contents intact.
database restore.
1. open your phpMyAdmin page.
2. click the database name on the left-hand navigational bar.
3. assuming you’re replacing the current database, you first need to drop all of the tables, so make sure to check all of the tables (the checkbox is immediately to the left of the Table column)
4. in the With selected: drop down box, choose Drop
5. now that you’ve emptied out your database, click on SQL on the top bar.
6. click the Browse button and locate the *.sql file that you created in your backup.
7. click Go.
you’ve now restored your database.
if you wanted to create an entirely new database with the same schema, simply open the *.sql file you created in your backup, and on the 7th line or so, you will see Database: `db_name`. just replace this with the new database name you wish to create.

Leave a Reply

Post Navigation