Skip to content

Dumping your MySQL Database

There are two ways you can use to dump your database:

  • mysqldump command using the CLI
  • Using Adminer, the visual database management tool

Using mysqldump

Dumping your entire database:

Type the following command:

1
 $ mysqldump -u [uname] -p db_name > db_backup.sql

Dumping ALL databases:

1
 $ mysqldump -u [uname] -p --all-databases > all_db_backup.sql

Dumping Specific tables:

1
 mysqldump -u [uname] -p db_name table1 table2 > table_backup.sql

Using Adminer

The easiest way to dump your database is to use the Adminer database manager tool (click on the link on the localhost home page to get to it).

After you login with your student credentials, select the database you want to dump (export), and the Export link:

Then (at the Export page), make sure the output is set to save, and the format is set to SQL. Then select the Export button:

You should see your SQL file in your ~/Downloads folder: