If phpMyAdmin fails to import your database—especially for large files over 128 MB—you can use SSH to import it manually. Follow these steps:
Step 1 - Upload the Database File
- Ensure your database file is in
.sql
format. - Upload it to your website’s
public_html
folder using FTP or the File Manager in cPanel. - If you haven’t already, create a new database in cPanel or clear an existing one.
Step 2 - Connect to Your Server via SSH
- Open a terminal and connect to your hosting account using SSH.
- Navigate to the
public_html
directory by running:cd public_html
- Verify that the database file is present by using:
If the file is missing, check the File Manager in cPanel to ensure it's uploaded correctly.ls
Step 3 - Import the Database
Run the following command to import the database:
mysql -u database_username -p database_name < file.sql
For example, if:
- Database name =
user_database
- Database username =
user_admin
- Uploaded file =
database.sql
The command will be:
mysql -u user_admin -p user_database < database.sql
You'll be prompted to enter the database password. Once entered, the import process will begin. The time required depends on the database size.
Step 4 - Confirm Completion
Once the import is finished, you’ll see a new command prompt line:
-bash-4.2$
This indicates the process is complete. You can now check phpMyAdmin to verify the imported tables.