phpMyAdmin allows you to export databases up to 256 MB (sometimes a little less, if the database has a lot of rows). If exporting with phpMyAdmin failed, you can export your database using SSH. Here are the steps:
Step 1 - Preparation
First, you would need to gather your database’s parameters, including the password. if you are not confident in the exact value of your database password - change it.
Step 2 - Connecting
- Connect to your hosting account via SSH.
- Make sure you are in your desired directory (the database will be exported to your current directory). To navigate between directories use cd and ls commands.
Step 3 - Export
Use this command to export the database:
mysqldump -u database_username -p database_name > file.sql
If the parameters of your database are:
- MySQL Database name: u123456789_database
- MySQL Username: u123456789_admin
And you wish to save the database as backup.sql, then the command will look like this:
mysqldump -u u123456789_admin -p u123456789_database > backup.sql
After that you will need to enter the database password - the exporting process will start. The export will take some time depending on the size of your database. When it is completed, a new line will appear:
This line means that the exporting process is done, you will see your database file appear in File Manager. 😊
That’s it! Now you know how to export your MySQL database.