Knowledge Base›Webhosting›Importing and Exporting a Database in phpMyAdmin

Webhosting – Importing and Exporting a Database in phpMyAdmin

On this pageWhen to use this guideDatabase ExportImport into a DatabaseCommon ProblemsFrequently Asked Questions

This guide describes how to manage a database using the administration tool phpMyAdmin ⧉. Log in with the database login name and password.

In this guide, you will learn:


When to use this guide


Database Export

When you export a database, you download the current data it contains. You can use export, for example, for manual backup.

Export the database by following these steps:

  1. Log in to phpMyAdmin ⧉ with the administrator account of the database you want to export.
  2. In the left menu, select the database from the drop-down list.
  3. In the top menu, select the tab Export.
  4. Keep the settings Export method: Quick and Format: SQL.
  5. Click the button Go.
  6. Save (download) the exported *.sql file.
Quick export of tables from the database
Quick export of tables from the database

Import into a Database

You can import the exported file back into the database, for example when restoring a backup.

You can only import files containing database tables. The system rejects files with multiple databases or unsupported commands. For more information about import errors, see the chapter Common Problems.

Import into the database by following these steps:

  1. Log in to phpMyAdmin ⧉ with the administrator account of the database you want to import the data into.
  2. In the left menu, select the database from the drop-down list.
  3. In the top menu, select the tab Import.
  4. Click the button Choose File and select the *.sql file you want to import.
  5. Click the button Go.
Importing data into the database
Importing data into the database

Uploading the file may take some time – it depends mainly on the amount of data and the connection speed. The system will notify you when the import is complete.

Message confirming a successful import
Message confirming a successful import

Common Problems

Exporting a database usually goes smoothly, but you may run into the following problems during import:

#1044 Access denied

Problem: The following error message is displayed #1044 Access denied for user ‘X’@’%’ to database ‘dXXXXXX_database’.

Cause: You will most often encounter this error when importing our data backup into a database with a different name, or when importing a database from another provider.

Access denied message when uploading a backup to a different database
Access denied message when uploading a backup to a different database

Solution: First, check that you are uploading the data to the correct database. If so, proceed with these steps:

  1. Open the SQL file with the data in any text editor.
  2. Find the lines starting with the words CREATE DATABASE and USE.
  3. Comment out these lines by placing the characters ‐‐ at the beginning of the line.
  4. Save the SQL file and try importing again.
Example of commenting out problematic code in an SQL file backup
Example of commenting out problematic code in an SQL file backup

#1046 No database selected

Problem: The following error message is displayed #1046 No database selected.

Cause: This common error means that you did not select a database before the import.

No database selected message and the solution by selecting a database in the left column
No database selected message and the solution by selecting a database in the left column

Solution: In the left column, select the database you want to import into, and run the import again.

#1062 Duplicate entry

Problem: The following error message is displayed #1062 Duplicate entry ‘X’ for key PRIMARY.

Cause: If you import data similar to the data already in the database, an error may occur because PMA prevents the data from being overwritten.

Error when attempting to overwrite existing data
Error when attempting to overwrite existing data

Solution: If you are sure you no longer need the old data, delete it and run the import again.

#1142 CREATE command denied

Problem: The following error message is displayed #1142 – CREATE command denied to user ‘wXXXXXX_database’@’X.X.X.X’ for table ‘table_name’.

Cause: You will encounter this error if you are logged in as the website user, i.e. wXXXXXX_….

Command error caused by a user with insufficient permissions
Command error caused by a user with insufficient permissions

Solution: Log in as a user with administrator rights (andXXXXXX_…) and run the import again. You can find the login details in the service setup email, or follow the guide Webhosting – Databases.

The website does not show the original data after import

Problem: The import completed without errors, but after restoring from the backup the website shows empty content or the original data is missing.

Cause: The website is connected to a different database than the one you imported the data into. This is typically a new, empty database specified in the website’s configuration file (in WordPress wp-config.php).

Solution: Check the database name in the configuration file and import the data into that database, or change it to the database you imported into. You can find your webhosting databases and their names in the guide Webhosting – Databases.


Frequently Asked Questions

I encountered an error during import that is not described in the guide. What should I do?

Take a screenshot ⧉ of the error message and send it to us using the form ⧉ together with the name of your Webhosting.

How do I move data from an old database to a new one?

Export the old database and import the file into the new one, always using the administrator account of that database. Then verify that the website uses the new database (in WordPress, in the wp-config.php file).

How do I move a database from another provider when automatic migration failed?

Export the data in the original provider’s interface (typically phpMyAdmin or Adminer) and import it into a database with us. The provider may block external access to the database, which is why automatic migration fails, see Webhosting – Automatic Data Migration.

I can’t log in to phpMyAdmin. What should I log in with?

Use the database login name and password; for import, use the administrator account (andXXXXXX_…). You can find the details in the service activation email, or in the guide Webhosting – Databases.

Was this article helpful?

Your feedback helps us improve our articles.

Your message goes to the documentation team, who do not reply to it. If you need help, contact us using the contact form. Do not include passwords or personal data.

Didn't find what you were looking for?

Ask other customers on the Help community website.