A large database import can stall when a browser upload hits a limit or phpMyAdmin runs out of time. The right method depends on your file and hosting access: use phpMyAdmin for a manageable SQL file, or the MySQL command-line client when the browser route can't handle it.

Before you start, protect the original data and create the destination database in cPanel. Then import the dump, confirm the tables arrived, and update your application's connection details.

Key Takeaways

  • Back up the database and keep an untouched copy of the SQL file before you import.
  • Create the database and its user with cPanel, then assign the user the required privileges.
  • Choose phpMyAdmin for an import it can accept. Use Terminal and the MySQL client when a browser upload is too large or times out.
  • Test the application after import, including the login or form features that read and write database records.

Protect the original database before importing

A large import changes a lot of data at once. If it fails halfway through or targets the wrong database, a clean backup gives you a way back.

Keep a restorable backup

Export the current database before making changes, and store that backup somewhere separate from the site files. If your hosting account has a backup tool, create a fresh backup before the import rather than relying only on an older scheduled copy.

Keep the original SQL dump too. Work from a copy, and don't edit the only version of a database export. Our cPanel site backup and restore guide covers the recovery side if you need to restore a database or site files.

A portable SSD and a stack of server backup disks on a desk with a blurred network appliance in the background.

Check what the dump contains

A database dump is commonly saved as an .sql file. Before importing, confirm you have the right file and that it came from the database you intend to move. A partial, damaged, or mismatched export can fail even when the import method is correct.

Also consider whether the destination database already has tables or data. Importing into an empty database can help avoid conflicts with existing tables. If you need to preserve existing records, make a backup and plan the merge carefully rather than treating the import as a simple replacement.

Create the destination database and user in cPanel

Set up the database in cPanel before opening phpMyAdmin. cPanel's database tools track the database and its user within the hosting account, which matters for management and backups.

Use Database Wizard or Manage My Databases

For a first setup, the MySQL Database Wizard guides you through creating a database, creating a user, and assigning access. You can also use Manage My Databases to create each part separately. The cPanel MySQL Databases documentation describes how its database tools work.

cPanel may add your account name as a prefix to the database and username. Record the full names shown in cPanel, not just the shorter names you typed. Your application will need the complete identifiers.

Assign the user and privileges

Creating a database user doesn't automatically give it access to the database. Attach the user to the destination database, then grant the privileges the application needs. Save the username and password securely.

Use cPanel to create databases and users rather than phpMyAdmin. cPanel warns that databases created directly in phpMyAdmin aren't mapped into its database-management system, which can interfere with cPanel backup and restoration features.

For a step-by-step setup, see our guide to creating a MySQL database in cPanel.

Choose the right import method

The best way to import a large MySQL database depends on the file size, server settings, and tools available in your account. A browser-based import is easy to start, but it can be limited by the hosting environment.

Use phpMyAdmin when the file can be uploaded

phpMyAdmin is a convenient choice when the SQL dump fits within the upload and execution limits in your hosting environment. Open it from cPanel, select the destination database, choose Import, select the SQL file, and start the import.

The cPanel phpMyAdmin documentation describes the tool's role in working with MySQL and MariaDB databases. phpMyAdmin is useful for importing and managing data after the database exists.

Use Terminal when the browser route falls short

If the upload fails because of a file or time limit, a command-line import may be a better fit. It reads the dump on the server instead of sending the whole file through a browser upload form.

This option requires Terminal or SSH access and comfort using shell commands. cPanel Terminal isn't available on every account. The host must enable shell access and the Terminal feature for the account.

A long aisle of modern server racks with status lights in a data center.

Import the SQL file through phpMyAdmin

When phpMyAdmin can handle the file, start by selecting the destination database in its left-hand panel. Check the database name before continuing. Then open Import, choose the correct SQL file from your computer, and begin the import.

Wait for phpMyAdmin to report that the process finished. For a large dump, the page may take time to respond. Avoid refreshing or closing it while the import is still running, since interrupting a request can leave the database only partly loaded.

After the result message appears, look for the imported tables in the database view. If you see an error, save its wording before trying again. A file that fails once may fail repeatedly until you address its cause, such as an upload limit, a time limit, or a problem in the SQL dump.

Use Terminal and the MySQL client for larger imports

A command-line import can be more practical when the SQL file is too large for phpMyAdmin. It does require shell access, the MySQL client, and careful use of the full database name and username.

Put the dump on the hosting account

Upload the SQL file to a directory your account can access, such as your home directory. Keep it out of the public website folder when possible, especially if the dump contains customer or account information. Note the exact file name and location.

You'll also need the complete cPanel database name and user, including any account prefix. The MySQL client will prompt for the password, so don't put the password directly into the command.

Run the import command

For a dump without its own CREATE DATABASE and USE statements, the general MySQL client pattern is:

mysql -u CPANEL_USER -p CPANEL_DATABASE < backup.sql

Replace the example names and file name with your actual cPanel credentials and SQL dump. If the file is in another directory, provide its full path. The command prompts for the database user's password.

Some dumps contain statements that select or create a database themselves. The correct command depends on the dump's contents. The MySQL Reference Manual's dump reload instructions shows the distinction between importing into a named database and loading a dump that includes database-selection statements.

cPanel warns that Terminal commands can affect account services or make an account inoperable. If you're not comfortable with shell commands, use phpMyAdmin when it can accept the file or ask your hosting support team about available import options. See cPanel's Terminal guidance for how access works.

Confirm the import and reconnect your application

A successful import is only one part of the move. Your application also needs to connect to the new database with the correct credentials.

Check the tables and data

Return to phpMyAdmin and confirm the expected tables appear in the destination database. If you can, inspect a few key tables and confirm they contain records. That helps catch an import that stopped early or targeted a different database.

For websites that accept orders, registrations, posts, or form submissions, pause new activity during a migration when practical. Otherwise, users may add records to the old database while you're importing an older copy.

Update the application's connection settings

Change the application's database settings to use the new full database name, username, and password. For a PHP application, those values may be in a configuration file such as db.php; other apps may use environment variables or a hosting control.

On cPanel, the database server is typically localhost. Use the full prefixed database name and username shown in cPanel. A correct password paired with an incomplete database name can still cause a connection error.

Load the site and test features that use the database, such as login, registration, or a form submission. If the homepage works but those features fail, check the credentials and confirm the user has access to the destination database.

Fix common large database import problems

When an import fails, the exact error usually points to the next step. Avoid changing several settings or rerunning the same import without understanding what stopped it.

The browser upload stops or times out

phpMyAdmin imports run through the hosting environment, so upload and execution limits can affect the process. If the SQL file exceeds what the browser route can handle, switch to Terminal and the MySQL client if your account provides access. Don't assume a single file-size limit applies to every cPanel account.

If you don't have shell access, contact your hosting provider for the available import path. The important detail is the error message and whether the failure happened during upload or while the SQL statements were running.

The import reports a database or SQL error

First confirm that you selected the intended destination database and that its user has the needed privileges. Then review the error message and the relevant part of the SQL dump. Repeatedly importing into a database that already contains conflicting tables can create new errors rather than fix the original one.

For a damaged or incomplete file, return to the source and create a fresh export if possible. Keep your original backup intact while troubleshooting. For careful phpMyAdmin access and safer database work, read our phpMyAdmin security best practices.

Frequently asked questions

Can I import a large MySQL database with phpMyAdmin?

Yes, when the file and import fit the limits of your hosting environment. If phpMyAdmin stops during upload or execution, a command-line import may be a better option when Terminal or SSH access is available.

Should I create the database in phpMyAdmin?

No. Create the database and user through cPanel's database tools, then use phpMyAdmin to import and manage the data. This keeps the database registered with cPanel's account-management tools.

What should I check if my site can't connect after the import?

Check the full database name and username, including cPanel prefixes. Confirm the password is current and the user is assigned to the correct database with the required privileges. Then test the site features that read and write database information.

Bring the database online with confidence

A successful import starts with a backup, a correctly prepared destination, and a method that fits your file. Use phpMyAdmin when it can handle the job, and the MySQL client when a browser upload gets in the way.

Once the data is in place, reconnect the application and test the features that depend on it. If large imports are part of your regular site work, choose hosting that matches the resources and support your website needs. ZADiC offers cPanel hosting plans from $4.99 to $18.99 per month.

We use cookies so you can have a great experience on our website. View more
Cookies settings
Accept
Decline
Privacy & Cookie policy
Privacy & Cookies policy
Cookie name Active

Who we are

Our website address is: https://zadic.net.

Comments

When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor’s IP address and browser user agent string to help spam detection. An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.

Media

If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.

Cookies

If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year. If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser. When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select "Remember Me", your login will persist for two weeks. If you log out of your account, the login cookies will be removed. If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.

Embedded content from other websites

Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website. These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.

Who we share your data with

If you request a password reset, your IP address will be included in the reset email.

How long we retain your data

If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue. For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.

What rights you have over your data

If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.

Where your data is sent

Visitor comments may be checked through an automated spam detection service.
Save settings
Cookies settings