Knowledge Base›Webhosting›Database Import and Export in phpMyAdmin

Webhosting – Database Import and Export in phpMyAdmin

On this pageDatabase 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:


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

Database export usually goes without any problem, but during import you may encounter these errors:

#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.


Frequently Asked Questions

Při pokusu o import jsem narazil na chybu, která není popsaná v návodu, co mám dělat?

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

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.