Questions? We're happy to help

How do I upload a database with SSH?

When uploading a database in phpMyAdmin it can happen that this fails because the database is too large. An alternative to this is uploading the database via SSH. With SSH you do not suffer from the upload limit of phpMyAdmin, in this article we explain which steps you should follow.

Steps

Step 1. Login to SSH with your cPanel user. You can do this via an SSH client / Terminal on your computer with the Terminal in cPanel.

Step 2. Navigate in SSH to the folder where the .sql file is what you want to upload, you do this with the following commands:

View current folder contents:

ls

Open a folder:

cd FOLDER NAME

Open parent folder:

cd ..

Step 3. When you located the folder where your .sql database export is run the following command:

mysql -p -u USERNAME DATABASE NAME < FILE.sql

Step 3a. At the USERNAME you enter the username of the database user, the password of this database user is required. Optionally you can reset it in cPanel via MySQL Databases.

Step 3b. In the DATABASE NAME you enter the full database name.

Step 3c. At FILE.sql enter the name of the .sql file you want to upload.

Step 4. If all data is correct you will be asked for the database user password, the .sql file will now be imported into the database. This may take some time, depending on the size.

Also read: How do I use SSH?

This knowledgebase article was last updated on: 11 Februari , 2020

Did this article help you?

Status

Ga naar onze statuspagina voor een overzicht van recente storingen en onderhoud.

Opening hours

Maandag — vrijdag 9:00 — 17:00