Importing and Exporting databases via SSH
PHPMyAdmin will sometimes timeout when trying to import/export databases due to the sizes, here you can learn how to import/export without needing to use PHPMyAdmin.
Exporting a database
- Log into your dedicated server via SSH
- Run the command
mysqldump -u <username> -h <host> -p <database name> > file.sql
This will connect to the database and export it in the file calledfile.sql
- Replace the details above accordingly with the database details you are looking to export and don't include
<>
, except for the one beforefile.sql
. - Hit enter and then type the password for the user to gain access to the database.
- Then wait for it to finish, then the database has been exporting correctly.
Importing a database
- Log into your dedicated server via SSH
- Run the command
mysql -u <username> -h <host> -p <database name> < file.sql
This will connect to the database and import the file calledfile.sql
- Replace the details above accordingly with the database details you are looking to export and don't include
<>
, except for the one beforefile.sql
. - Hit enter and then type the password for the user to gain access to the database.
- Then wait for it to finish, then the database has been exporting correctly.
Download an export from your dedicated server
- Download an FTP Client such as: https://filezilla-project.org/download.php?type=client
- Enter the following details to login:
- Host:
sftp://"The machines IP address"
- Username:
root
- Password:
Your root SSH password
.
- Download the
.sql
file by dragging it from the right window to the left to begin the download.

You can now succesfully transfer databases between different hosts.
Updated on: 30/01/2021
Thank you!