1. Home
  2. Web Hosting
  3. Account Management
  4. How to Import a Database of More Than 50 MB to a World Account in SSH

How to Import a Database of More Than 50 MB to a World Account in SSH

It is possible to import a database of more than 50 MB via SSH with the puTTY software under Windows or directly with the terminal under the MacOS environment. At first it will connect in SSH to his account (how).

This procedure is for advanced users. Be sure to save your work first!

N0C users must refer to the article explaining how to Import/Export Database in Command Line (User Mode).

Preparation of the hosting


1. You will need to have a blank database in your cPanel account to do the import. Go to the “MySQL Database Wizard” tool and follow the creation steps.

2. Drop the .sql file into a folder of your hosting (in the example, the file is in the / home / usercpanel / dumpsql)

3. Use the “Load” button in the interface to place your .sql file in the folder we just created. “/ Home / usercpanel / dumpsql”

3.1 Your file is now in the hosting.

Login in SSH

4. Now open the puTTY software. Login and put your domain name in the host (how).

5. Scroll down to the folder that contains the .sql file. In this example, it is the folder “dumpsql”. The order will be >> cd dumpsql

cd dumpsql

Import database in command line (SSH)

6. You will now need to use the following command:

mysql -p -u usercpanel database_name <dump.sql

You will of course have to adapt this command with your cPanel username as well as your database name and the .sql file.
You will then need to enter your cPanel password to confirm the mysql command.

7. That’s it, your import via SSH is done. You can connect to phpMyAdmin to check your database.

Updated on 18 July 2024

Was this article helpful?

Related Articles