This guide describes database administration using the phpMyAdmin tool.
Log in with the database login name and password.
In this article, you will learn:
Database Export
When you export a database, you download the current data that is in it. Most commonly, you export databases as a part of manual backups.
Follow these steps to export the database:
- Log into the phpMyAdmin interface with the database admin account.
- In the left menu, select the database from the dropdown menu.
- In the top menu, click the Export tab.
- Keep the default settings – Export Method: Quick and Format: SQL.
- Click the Go button.
- Save (download) the exported *.sql file.
Import into Database
You can import the exported file into the database again, for example when restoring a backup.
You can only import files containing database tables. The system will reject files with multiple databases or unsupported commands. For more information about import errors, see the Common Issues chapter.
Follow these steps to import tables into the database:
- Log into the phpMyAdmin interface with the database admin account.
- In the left menu, select the database from the dropdown menu.
- In the top menu, click the Import tab.
- Click the Upload File button and choose an *.sql file to import.
- Click Go.
Uploading the file may take some time – it mainly depends on the data volume and connection speed. The system will inform you when the import is complete.
Common Issues
Most of the time, the database export runs smoothly, but you may encounter the following errors during import:
#1044 Access denied
Issue: There is an error: #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.
Solution: First, check that you are actually uploading data to the correct database. If so, proceed with these steps:
- Open the SQL data file in any text editor (such as Notepad).
- Find the rows starting CREATE DATABASE and USE.
- Disable these commands by placing the characters ‐‐ at the beginning of these rows.
- Save the SQL file and try importing again.
#1046 No database selected
Issue: There is an error #1046 No database selected.
Cause: This common issue arises when you click Import without first selecting a database.
Solution: In the left column, select the database to which you want to import, and perform the import again.
#1062 Duplicate entry
Issue: There is an error: #1062 Duplicate entry ‘X’ for key PRIMARY.
Cause: If you import data that is similar to what is already in the database, you may encounter an error that prevents PMA from overwriting the data.
Solution: If you are sure that you no longer need the old data, delete it, and import again.
#1142 CREATE command denied
Issue: There is an error: #1142 – CREATE command denied to user ‘wXXXXXX_database’@’X.X.X.X’ for table ‘table_name’.
Cause: This error occurs if you log in as the web database user (wXXXXXX_….).
Solution: Log in as an administrator database user (aXXXXXX_….), and perform the import again. You can find the login info in the database creation email, or you can update it in the customer administration panel according to the guide Webhosting – Databases.
FAQ
Question: I encountered an error that isn’t mentioned in the article, what should I do?
Answer: Take a screenshot and send it to us via the form. Include the name of the webhosting and database.
Question: I have a database restored from your backup, and I am afraid that I will mess something up with the import. Can you import it for me?
Answer: Yes, send an authorized request (from the account containing the Webhosting in question) via the contact form. Please note that database imports have one of the lowest priorities of all technical requests, so it may take hours, and in some cases even days, to complete.