Import MySQL database via SSH

A faster way of importing your database is via Secure Shell. Learn how to import MySQL database via SSH by following the instructions below.

(Please note that this is only applicable to Dedicated Server and VPS hosting packages only. If you are in a Shared Hosting plan, you may import the SQL via phpMyAdmin.)

Import MySQL database via SSH (Windows)

Step 1. Connect to SSH.

Step 2. Type in pwd to check your current directory.

Step 3. Go to the specific directory wherein the SQL file is located. Use the following command:

cd directory/

Press Enter.

(Note: Replace directory with the correct directory name.)

Step 4. Execute the following command.

mysql -h localhost -u databaseusername -p databasename < filetoimport.sql

(Replace databaseusername with your database user name, databasename with your database name and filtoimport.sql with the SQL file you want to import.)

Import MySQL database via SSH

Press Enter.

Step 5. Enter the password. Your screen may not show the information so make sure that you are typing the correct information. Take note that password is case sensitive. Press Enter.

enter-password-ssh-sql-import

Step 6. The SQL file is now successfully imported. You may check this through the phpMyAdmin or viewing the content of the file.

view-sql-ssh

Do not hesitate to contact our support team if you have further questions.

Import MySQL database via SSH

(Visited 38 times, 1 visits today)