Exporting a database over SSH using cPanel
In case exporting a database through phpMyAdmin didn't work you’ll export your database using SSH. Here are the steps:
Step 1 - Preparation
First, you’d need to gather your database’s parameters, including the password.
Step 2 – Connecting
- Connect to your hosting account via SSH.
- Make sure you’re in your required 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:
If the parameters of your database are:
- MySQL Database name: user_database
- MySQL Username: user_admin
And you would like to save lots of the database as backup.sql, then the command will appear as if this:
After that you’ll get to enter the database password - the exporting process will start. The export will take a while counting on the dimensions of your database. When it’s completed, a replacement line will appear:
This line means the exporting process is completed, you’ll see your database file appear in File Manager.
That’s it! Now you know the way to export your MySQL database.