There are two ways to export a database. You can either use phpMyAdmin or SSH commands. If you are not familiar with terminal commands we recommend you stick to the phpMyAdmin way.
Exporting Databases Through PhpMyAdmin
Before exporting make sure you are on the correct database, and not information_schema. When you have clicked on the database you want to export you can easily go to the export tab and click finish. This will save the database dump locally on your computer.
Exporting Databases with Command Line Tools
For exporting your database through terminal, you need to access the server through SSH. Once you have accessed the server you insert your information into this command:
mysqldump --single-transaction -u USERNAME -p DATABASENAME > FILENAME.sql
Or if you have a WordPress site you can use this CLI command in your WordPress directory (normally ~/public/):
wp db export
If you want to go a step further to gzip your sql file you can run this command:
mysqldump --single-transaction -u USERNAME -p DATABASENAME | gzip > db_dump.sql.gz
To extract your gzipped sql file you can run this command:
After filling in your information, you are asked to enter the database password. After filling in the correct password, the server will process the information and create a database dump in your current directory.
If you want to transfer this database dump to you local machine or to another server, you can do this through the
rsync command or through FileZilla.
Give us your feedback on this article
Did this help you?
Want to speed up your site, easily?
Set up your site on Servebolt, free of charge for 60 days, and see for yourself how fast it can be on our extremely fast hosting.
A faster site converts better, ranks better on Google, and is better for the climate.