Use phpMyAdmin to load an SQL export into a database you have already created in cPanel. Importing executes the statements contained in the file. Depending on that file, it can add records, create tables, or replace existing data, so review the destination and backup before starting.
The import action may be labelled Import or Go. Upload limits and supported features depend on the installed phpMyAdmin and server configuration.
Before you start
- Obtain an SQL export from a trusted source and back up any existing destination data. For a migration, prefer an empty destination unless the application's instructions specify otherwise.
- Create the database and its user in cPanel, then assign the required privileges. Check the upload limit displayed on phpMyAdmin's Import screen.
Instructions
Open phpMyAdmin
In cPanel, open Databases, then phpMyAdmin. Select the complete destination database name in the left navigation.
Confirm the destination
Check the selected database at the top of the page. Do not import at server level or select another application's database by mistake.
Choose the import file
Open Import and use Choose File to select the SQL export, or a supported compressed SQL file. Confirm SQL is the appropriate format.
Run the import once
Review the available options and keep the export's intended character encoding. Click Import or Go, depending on the version, then wait for the completion message.
Review and connect
Check the resulting tables and any reported errors. Configure the application to use the destination database and test it only after confirming the import completed.
Check the result
- Confirm the expected tables and sample records are present; a success message alone does not prove you selected the correct database.
- Test the application and check important text for character encoding problems.
Troubleshooting
- The upload is too large or times out.
- Ask support for an approved larger-import method. Do not repeatedly upload into a partly imported database without first checking its state.
- The import reports duplicate tables, keys, or unsupported collation.
- Keep the exact error. Confirm the destination and export compatibility, then have the export or restore plan corrected before retrying; do not delete existing tables blindly.
Watch the video
The video may show an older interface. Use the written instructions above when screen names differ.
Continue with a related task
- How to Create a MySQL or MariaDB Database in cPanel
- How to Create a Database User in cPanel
- How to Add a User to a Database and Set Privileges in cPanel
- How to Export a Database Table with phpMyAdmin in cPanel