A database import with phpMyAdmin can fail for various reasons. The SQL file may be too large, the import may abort during processing, or MySQL may output a specific error message regarding tables, permissions, character sets, or existing records.
It is important not to restart the same process immediately after a failed import. A canceled import may have already created some of the tables and data. A second import over this intermediate state can cause additional errors.
In this guide, we will show you how to systematically analyze a failed phpMyAdmin import, categorize typical error messages, and decide how to proceed safely.
Important: Note down or copy the complete error message before you change anything. The exact message is much more helpful for error analysis than the general information that the import „does not work“.
First, determine at which point the import fails #
Not every import error has the same cause. Therefore, first check what exactly happened.
Typical situations are:
- the SQL file cannot be selected or uploaded at all
- phpMyAdmin reports an error even before the actual import
- the import starts, but aborts during processing
- phpMyAdmin displays a specific MySQL or SQL error message
- The import is reported as successful, but the website does not work afterward.
- part of the tables was imported, the rest is missing
These cases must be treated differently.
Check the database status before a new attempt #
Open the relevant target database in phpMyAdmin and check if tables already exist.
If an empty database existed before the import and tables are now displayed, at least part of the SQL file was processed.
Attention: Do not simply restart a failed import over a partially imported database. This can cause errors due to already existing tables or duplicate records.
Read the error message completely #
phpMyAdmin or the database server provides a specific message for many problems.
Note:
- Error number, if available
- full error text
- affected table
- affected SQL statement, if displayed
- approximate point where the import was interrupted
A screenshot of the complete message can also be helpful for a later analysis.
The SQL file is larger than the allowed upload limit #
If phpMyAdmin only accepts files up to a certain size, a larger SQL file cannot be imported via the normal upload.
Depending on the server configuration, the import page can display a maximum allowable file size.
If your SQL file is larger than this limit, the problem is not automatically the database itself. The file may not even reach phpMyAdmin completely.
Important: Do not change PHP limits randomly. First, check which limit is actually being reached and whether the setting in question should even be changed by yourself in your hosting environment.
Compress SQL file #
Depending on the phpMyAdmin and server configuration, compressed SQL files may be supported.
A file like:
database.sql
can be significantly compressed depending on the data content.
A supported compressed variant could look like this, for example:
database.sql.gz
You can determine if and which compression formats are accepted by looking at the import interface or the specific server configuration.
However, compression only helps with a size issue of the transferred file. It does not solve SQL, permission, or table errors.
Import started, but it is timing out #
For large or complex SQL files, the import can start and later fail due to a time limit.
This differs from a pure upload limit: the file was accepted and at least partially processed.
In this case, be sure to check whether tables and records already exist in the target database.
Browser shows a blank page or connection drops #
If the browser no longer displays a normal success message during a long import, that does not automatically mean that nothing was imported at all.
Then open the target database again in phpMyAdmin and check its status.
Do not restart the import until it has been clarified what has already been processed.
Partially imported database #
SQL files are typically processed statement by statement. If the process is aborted in the meantime, the previous statements may have already been executed.
The target database can then look like this, for example:
Table A → available
Table B → available
Table C → available
Table D → import aborted here
further tables → missing
Such a database is no longer empty, but may not be complete either.
Important: Treat a canceled import as a potential intermediate state. Check the database first before deleting, re-importing, or using the website productively with it.
Start fresh or continue import? #
Which procedure is correct depends on the SQL file, the error, and the state of the target database.
For a newly created database intended exclusively for this migration, a clean restart may make more sense than attempting to manually resume an unclear partial import.
If the database, on the other hand, already contains production data, you must under no circumstances simply delete existing tables.
Attention: Only delete or reset a partially imported database if it is certain that it contains no required productive data and a suitable initial backup exists.
Error #1044 – Access to the database denied #
An error message with an error number #1044 typically indicates a permission issue related to a database.
This can occur, for example, when the SQL file attempts to use or create a database for which the current database user or hosting account does not have the necessary privileges.
Check in particular whether the SQL file contains statements such as:
CREATE DATABASE ...
USE ...
contains and whether these match the target environment.
Why CREATE DATABASE can be problematic in hosting #
In a cPanel hosting environment, databases are usually created via cPanel and assigned to the hosting account.
An imported SQL file should therefore not attempt to create arbitrary new databases at the server level without being checked.
Create the required target database instead as in Create MySQL database in cPanel described and then import the data into this database.
USE statement refers to an old database name #
An SQL file from another hosting environment may contain an earlier database name.
For example:
USE alteraccount_wordpress;
At the new location, on the other hand, the database can, for example:
newaccount_wordpress
be called.
Such a deviation can be relevant during import.
Attention: Do not blindly remove or modify SQL statements. First, check which statements are present, what they do, and which target database is actually supposed to be used.
Error #1045 – Access denied #
Error #1045 typically represents a failed authentication or denied database access.
If the error occurs in connection with an application, check:
- complete database username
- Database user password
- Database host
- Assigning the user to the database
- User permissions
We explain how to properly set up a database user at Create MySQL user and assign to a database.
Import was successful, but the website still reports #1045 or "Access denied" #
In this case, the database may be completely imported and only the application is using incorrect access credentials.
In WordPress, you should then pay particular attention to the values in:
wp-config.php
check.
These include:
DB_NAME
DB_USER
DB_PASSWORD
DB_HOST
Reimporting the database does not fix incorrect application credentials.
Error #1050 – Table already exists #
A message like:
#1050 - Table already exists
means that the SQL file wants to create a table that already exists in the target database.
This frequently occurs when:
- an import has already been partially carried out
- the same import was started a second time
- the target database was not empty before the import
- another installation is already using the same table names
Do not immediately delete tables for #1050 #
First, check why the table already exists.
If it is a production table, deleting it could cause data loss.
If, on the other hand, the database was created exclusively for a new migration and an initial import has demonstrably failed, a clean restart can be a viable approach.
The decision depends on the actual state of the database.
Error #1062 – Duplicate entry #
Error #1062 typically indicates that a value should be inserted that already exists due to a unique key.
For example, a message can essentially be:
Duplicate entry
point out.
This can occur, among other things, when data has already been imported and is then to be inserted again.
Why a second import can cause #1062 #
If the initial import has already created records, a repeated import may attempt to insert the same IDs or other unique values again.
The database prevents this if corresponding uniqueness rules are defined.
Important: A
#1062An error is no reason to remove unique keys on suspicion. These are part of the database structure and can be crucial for the correct functioning of the application.
Error #1064 – SQL syntax error #
Error #1064 typically indicates an SQL statement that cannot be processed in this form by the database server.
Possible causes can be:
- a damaged or incomplete SQL file
- a manually incorrectly modified SQL statement
- incompatible syntax
- an issue at a specific location in the export file
The error message often names a location or a section near which the error was detected.
Do not randomly delete lines in case of syntax errors #
A seemingly problematic line can be part of a larger SQL statement.
If you remove individual lines on a hunch, the file may fail at another point afterwards or import incomplete data.
First check the exact error message and the origin of the SQL file.
Error due to unknown collation #
When importing a database from another server environment, a message may appear stating that a specific collation is unknown or not supported.
This can happen, for example, if the source and destination use different database server versions or different supported collations.
The error message may essentially contain:
Unknown collation
Do not blindly replace collation #
There are numerous guides on the internet that recommend replacing a collation across the entire SQL file with another one wholesale.
That can work in a specific case, but it is not a universal solution.
Check first:
- which collation the source database uses
- which collation the target server supports
- which character set is associated with it
- whether the application has special requirements
Attention: Character set and collation affect the storage and processing of text. Ill-considered changes can lead to incorrectly displayed characters or unexpected comparison and sorting behavior.
Umlauts and special characters are incorrect after the import #
When characters like:
ä
ö
ü
é
à
appear incorrectly after import, it may be a character set issue.
Check whether the problem already exists in the SQL file or occurs only after the import.
Do not change the entire database collation immediately. The cause can lie in various parts of the export and import chain.
Error due to unknown character set #
An unsupported character set can also prevent an import.
In this case, it should first be clarified with which database system or version the SQL file was generated and which character sets the target system supports.
Error in DEFINER statements #
SQL exports can include details about a specific for certain database objects DEFINER contain.
These can refer to a user of the original server environment who does not exist on the target system or is not allowed to be used there.
For example, an SQL file can contain a server-level user that only existed on the previous system.
If an error message explicitly refers to DEFINER or refers to corresponding permissions, exactly this part of the SQL file or the affected database objects should be checked.
Important: Do not remove all of them across the board
DEFINER-Details from each SQL file. First, check which objects are affected and whether they are needed for the application.
Permission denied error #
An SQL export from an environment with extensive database permissions may contain statements that are not permitted in a normal hosting environment.
This does not automatically mean that your hosting account is misconfigured.
Certain server-wide administrative actions are deliberately not enabled for individual hosting accounts in shared hosting.
Import fails at a specific table #
If the error always occurs with the same table, note:
- Table name
- Error number
- Error message
- approximate position within the import
This makes it much easier to specifically distinguish whether, for example, the table structure, a data record, or an unsupported SQL statement is causing the problem.
Import appears to be stuck on a large table #
Individual tables can be much larger than the rest of a database.
In WordPress, for example, log, statistics, cache, or other tables created by extensions can contain significant amounts of data.
Do not abort an import just because a large table takes longer.
Check if phpMyAdmin is actually reporting an error or if the process is still being processed.
How to split very large SQL files? #
Splitting a SQL file can be a technical solution in certain situations, but it should not be done by arbitrarily cutting it at random points.
SQL statements can span many lines. If a statement is split in the middle of the command, invalid files are created.
Attention: Only split large SQL files using an appropriate method or sufficient SQL knowledge. A standard text editor and an arbitrary line number are not a safe method for this.
SQL file might be incomplete #
If the original export was already aborted, the generated SQL file may be incomplete.
A later import can then also fail, even though there is nothing wrong with the target database.
If the source is still available, a new full export may be the better solution.
We explain how to create an export correctly at Export database with phpMyAdmin.
SQL file is 0 bytes or unusually small #
An empty or unexpectedly small file can indicate that something did not work as expected during the export itself.
Although the file size alone is not definitive proof of completeness, you should investigate obvious deviations before importing.
Invalid file format #
Check if this is actually a suitable database export.
A file with the extension:
.sql
is a typical format for a SQL export.
Any arbitrary CSV, XML, ZIP, or text file is not automatically a complete SQL database export.
Compressed file is not accepted #
If phpMyAdmin does not accept a compressed file, first check which compression formats are actually supported in the import interface.
Do not just change the file extension.
Renaming of:
database.zip
in
database.sql
do not convert the content into an SQL file.
Import is successful, but website shows a database error #
A successful import and a working database connection are two different things.
If the tables exist but the website cannot connect, check the application's credentials.
Especially with WordPress:
DB_NAME
DB_USER
DB_PASSWORD
DB_HOST
Also check if the database user has been assigned to the correct database.
Import successful, but website shows incorrect content #
If the website works after the import but does not contain the expected content, you should check whether the correct backup version was actually imported.
Possible causes include, for example:
- used older SQL backup
- exported wrong source database
- Application accesses another database
- Import was incomplete
Do not immediately import another backup over it. First, find out which database the application is currently using.
Import successful, but the website is still using the old database #
Creating and importing a new database does not automatically change your website's configuration.
The application continues to use the database credentials stored in its configuration.
In WordPress, this is usually:
wp-config.php
Error after changing the database password #
If you changed the database user's password during the migration, the new password must also be updated in the application.
A change in cPanel does not automatically update your website's configuration files.
Import successful, but tables are missing #
If only some of the expected tables are present, check the original SQL file and the import message first.
Possible causes are:
- incomplete export
- aborted import
- only selected tables were exported
- Error during import
Do not assume that tables are missing based solely on an expected number of tables. Applications and plugins can use a varying number of tables.
Do not confuse the WordPress prefix with missing tables #
In WordPress, tables do not have to be:
wp_
Start.
For example, an installation can have a prefix such as:
abc_
use.
Therefore, check the actual table names before assuming that no WordPress data is present.
Import does not automatically overwrite all old data #
Whether existing tables or records are replaced depends on the SQL statements in the import file.
For example, a SQL file can:
- create new tables
- Insert records
- delete existing tables and recreate them
- modify existing data
That is why you should never assume that every import automatically creates an identical database state.
DROP TABLE in the SQL file #
Does the backup contain instructions like:
DROP TABLE ...
Can existing tables be deleted before they are recreated?.
This can be useful for a targeted recovery, but is particularly dangerous if the target database is incorrect.
Attention: Choosing the right target database is crucial for a SQL file with
DROP-Instructions are particularly important.
INSERT error after an aborted import #
If a first import has already inserted records, a second attempt can fail on the same records.
This is another reason why a failed import should not simply be retried.
Foreign key error #
Certain applications use relationships between tables that can be secured by so-called foreign keys.
If an import violates such relationships, the database server can output a corresponding error message.
Do not disable such checks on suspicion. They can protect the consistency of related data.
SQL_MODE or version differences #
An SQL file from a different database server version may contain statements or data that are processed more strictly or differently by the target system.
If the error message indicates a specific SQL mode, data type, or invalid value, the compatibility between the source and target environment should be checked.
Server-wide database settings should not be changed solely to bypass a single import error.
Import from very old hosting environment #
Compatibility issues can occur more frequently with databases from significantly older server environments.
This may include, for example:
- legacy character sets
- divergent collations
- obsolete SQL syntax
- different database server versions
- legacy application structures
In such cases, the specific error message is crucial for how to proceed.
Import from newer database server version #
The reverse case can also be problematic: an SQL file was generated on a system that supports functions or collations that do not exist on the target system.
Therefore, in case of compatibility errors, check both the source and the target environment.
Not every error message is a phpMyAdmin error #
phpMyAdmin is the interface through which you start the import. However, many of the error messages displayed originate from the underlying database server.
Therefore, an error during an import does not automatically mean that phpMyAdmin itself is broken.
Distinguish between PHP limits and database errors #
An upload or runtime limit affects the technical import process via the web interface.
An error like:
#1050 - Table already exists
on the other hand, concerns the processing of SQL statements within the database.
Increasing a PHP limit does not resolve such an SQL error.
Do not change PHP settings for every import error #
If an upload or execution limit is actually relevant, PHP settings can play a role.
We will cover how to manage PHP settings in cPanel later under Change PHP settings in cPanel.
Check the specific error message first, though. SQL syntax, table, or permission errors cannot be resolved by larger PHP limits.
When a new clean import can make sense #
A new import into a clean database can be particularly useful when:
- the target database was created exclusively for this new migration
- no productive data is contained therein
- the previous import was demonstrably only partially executed
- the cause of the abortion has been fixed
- complete output protection is in place
Before you remove data, these prerequisites must be clearly clarified.
When you should not empty the existing database #
Do not empty or delete a database if:
- an active website it uses
- you do not know for sure to whom it belongs
- new productive data could have been generated in it
- no current backup is available
- you have not yet analyzed the previous import state
Basic rule: Unclear database state means analyze first – do not delete.
Systematic troubleshooting for a failed import #
- Do not restart the import immediately.
- Save complete error message.
- Check correct target database.
- Check if tables have already been imported.
- Check the size and format of the SQL file.
- Determine whether there is an upload, runtime, SQL, permission, or compatibility issue.
- Check error number and affected statement for SQL errors.
- Document the state of a partially imported database.
- Fix the cause.
- Only then decide whether to continue the import or start cleanly over.
Quick classification of typical errors #
| Problem | Likely range |
|---|---|
| File cannot be uploaded because of its size | Upload limit |
| Import started and aborts later | Runtime, size, or SQL error |
#1044 | Database permission / unauthorized database operation |
#1045 | Authentication / Access |
#1050 | Table already exists |
#1062 | duplicate unique value |
#1064 | SQL syntax |
Unknown collation | Compatibility / Collation |
| Incorrect umlauts or special characters | Character set / Export-import chain |
| Website reports database connection error | Access Data / User Assignment |
| Tables are missing after import | Partial import or incomplete export |
Do not „repair“ anything before submitting a support request“ #
If you cannot clearly identify the cause, it is often better to leave the current state unchanged.
Additional deletion, import, or SQL attempts can result in the loss of important clues regarding the original cause.
Therefore, note or back up the error message and the current database state first.
What information does support need? #
For a targeted analysis, the following information is particularly helpful:
- affected domain or application
- full name of the target database
- Size of the SQL file
- File format or compression
- whether the database was empty before the import
- whether tables have already been imported
- exact error code
- full error text
- affected table, if displayed
- whether it is migration or recovery
- what hosting or database environment the backup comes from, if known
A screenshot of the error message can also be helpful.
Safety: Do not transmit database passwords and do not make SQL backups containing sensitive data publicly available for download.
Summary #
If a phpMyAdmin import fails, you should not restart it immediately. First, check the complete error message and verify whether the target database already contains partially imported tables or records.
Problems before the actual import often point to file size, upload, or format. If an import that is already running aborts, time limits, SQL errors, or compatibility issues may play a role.
Errors like #1044, #1045, #1050, #1062 or #1064 indicate different causes and should be handled according to the specific error message. Increasing PHP limits is therefore not a universal solution for database errors.
Special care must be taken with partially imported databases. Only delete existing tables or databases if it is completely certain that no required production data is affected and a suitable backup is available.
Therefore, the most important rule when an import fails is: Save the error message, check the database state, determine the cause – and only then start the next import attempt.