How to import large Databases How to import large Databases

You may need to import large databases, exceeding the phpMyAdmin limit and requiring a different procedure from the regular one. 

Before starting a large database importation make sure that the user and the database are created and associated. Then you can choose between two different methods to process the database importation: via SSH or via MySQLDumper.

If you prefer to import your database via SSH you will have to:

  1. Upload the db.sql file to import via FTP in the account's main directory;
  2. Access the service via SSH;
  3. Execute the following command in the SSH terminal: 
    mysql -p -u username databse_name <dbname.sql (where username stands for the database username, database_name  for the database name and dbname.sql for the database to import);
  4. Type the database user's password and click on "Enter";

If the procedure has been successfully processed the terminal will be in stand by until the end of the operation and, if no error occurs, the import is successful.

You can also choose to import your database via MySQLDumper, an open source tool for MySQL database backup that you can easily download online and use to restore MySQL databases, especially on shared hosting.

In this case, you will have to:

  1. Download the program, upload it and unzip it in the public_html folder, using your cPanel control panel's "File Manager";
  2. Open in your browser the link (replace with the domain associated to your cPanel account);
  3. Select "English" and click on "Install";
  4. Fill in all the required fields:
    Database hostname: localhost
    Port: empty
    Socket: empty
  5. Click on "Save" and continue to install;
  6. Upload the backup file (.sql or .zip) via FTP in public_html/msd1.24.4/work/backup folder;
  7. Back to browser and click on the menu on "Restore";
  8. Select the backup and click on "Restore" (if the backup is not visible click on "Other programs backup").


Have you found it useful?

share Related research