Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  MySQL  >  MySQL Database Import Is Failing, Reason: The .sql File Is Too Big
Top Scroll

MySQL Database Import Is Failing, Reason: The .sql File Is Too Big

 2 min

Uploading browser-based file can fail in case the file size that you are trying to upload is larger as compared to the HTTP post size configuration on the web server.

In case this happens, your MySQL database can be restored just by logging onto your account via SSH client (or if you want you can get the web-based terminal access in cPanel).

After creating the database and the database user in cPanel, check below the steps to import the .sql database file:

1. Using an FTP client or the cPanel File Manager, upload the .sql file to your /public_html directory.

2. Then start a terminal client (PuTTy, etc.) and connect to your account.

3. Execute the below command in the console:

mysql -u mysql_user -p mysql_db < public_html/database.sql

Ensure that you replace mysql_user with your database username, mysql_db with your database name, and database.sql with the name of.sql file that you have uploaded.

4. Enter the MySQL user password and click on your enter key.

Now, if you don’t get an error in your terminal client, it indicates that the database import was successful.

If there is still trouble importing your database after following these steps, please open a ticket in MilesWeb and include the .sql file name and the name of the database you want to import to. Our support team will assist you with the import.

Also Read:

How to Optimize a MySQL Database Using SSH?

How To Create MySQL Tables In phpMyAdmin?

For our Knowledge Base visitors only
Get 10% OFF on Hosting
Special Offer!
Claim the discount before it’s too late. Use the coupon code:
Note: Copy the coupon code and apply it on checkout.