If you encountered difficulties exporting a database through phpMyAdmin, you can export your database using SSH. Just follow these steps:
Step 1 - Preparation
Gather your database details: database name, user and password.
If you have forgotten your database password, follow this guide: How to a Change a Database Password on cPanel
Step 2 - Connecting via SSH
Connect to your hosting via SSH
Use the
ls
command to ensure you are in the root directory, that is, public_html. If you are in a different directory, use thels
andcd
commands to navigate to the correct location
Step 3 - Export the Database
Use this command to export the database:
mysqldump -u database_username -p database_name > file.sql
For example, if the parameters of your database are:
MySQL Database name: user_database
MySQL Username: user_admin
Uploaded database file: backup.sql
The command will look like this:
mysqldump -u user_admin -p user_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:
-bash-4.2$
This line means that the exporting process is done. You can verify that your database file is available on the location using the File Manager.