EN

Web hosting

Import and export a database with phpMyAdmin

Export and import a MySQL or MariaDB database with phpMyAdmin from Plesk, handle large files and fix the most common import errors.

7 min read, updated on 18 November 2026

On this page

This guide explains how to copy a database to an SQL file and how to load that file into a database on your hosting. Use it for a one-off backup, a website migration or a return to an earlier state.

What you need

  • Access to your Plesk interface.
  • For an import, a destination database that already exists. See Create a database.
  • For an import, your .sql, .sql.gz or .sql.zip file.

Open phpMyAdmin

  1. Log in to Plesk.
  2. Open Websites & Domains, then Databases.
  3. Find your database and click phpMyAdmin.

phpMyAdmin opens in a new tab, with your database listed in the left column. Its language may differ from the Plesk interface. The labels below are those of the English version.

Export a database

  1. Click the database name in the left column.
  2. Open the Export tab.
  3. Choose the Export method:
    • Quick is enough for a full copy of the database.
    • Custom lets you choose tables and options.
  4. Make sure the format is SQL.
  5. In Custom mode, adjust these options:
    • Under Output, keep Save output to a file and choose gzipped compression for a large database.
    • Under Object creation options, tick Add DROP TABLE… if the file must replace existing tables when imported.
  6. Click Export and keep the downloaded file.

The DROP TABLE option changes nothing at export time. It adds a statement to the file that will drop tables of the same name during the import.

To check the export, make sure its size looks right. Then open the uncompressed file in a text editor: it should contain CREATE TABLE and INSERT INTO statements.

Import a database

  1. In the left column, click the destination database. This avoids error #1046.
  2. Open the Import tab.
  3. Under File to import, click Browse your computer and choose your file. The maximum accepted size is shown next to it.
  4. Leave Character set of the file on utf-8, unless you know the file uses another encoding.
  5. Under Partial import, keep Allow the interruption of an import ticked.
  6. Make sure the format is SQL.
  7. Click Import (or Go, depending on the version) and wait for the success message without closing the tab.

Import a file that is too large

If the file exceeds the displayed limit, try these solutions in order.

1. Compress the file. phpMyAdmin accepts compressed files. The name must end in .sql.gz or .sql.zip.

2. Use the Plesk import. It does not go through phpMyAdmin:

  1. Put the SQL file in a ZIP archive.
  2. Open Websites & Domains, then Databases.
  3. Click Import Dump for the database.
  4. Choose Upload, then Browse, and select the archive. You can also choose Import to use a file already on the server, for example one uploaded over FTP outside httpdocs.
  5. Confirm and check the result.

3. Resume an interrupted import. If phpMyAdmin reports that the time limit was reached, resubmit the same file as it suggests. You can also enter the number of queries already processed in Skip this number of queries (for SQL) starting from the first one.

4. Split the file into several parts, or contact support if none of these methods is enough.

Plesk also offers Export Dump under Databases. It produces a ZIP archive in SQL format, saved to the server folder you choose. The Automatically download dump after creation option also puts a copy on your computer.

Check the result

  1. In phpMyAdmin, open the database's Structure tab and review the list of tables.
  2. Compare the row counts of a few important tables with the original database. For InnoDB tables, this count is sometimes an estimate.
  3. Make sure your website uses the right connection settings, for example in wp-config.php for WordPress.
  4. Open the site and test a page that reads from the database, as well as the admin login.
  5. Delete any import files you no longer need from the server.

Troubleshooting

Error Likely cause What to do
#1046 - No database selected No database was selected Click the database in the left column, then run the import again
#1044 - Access denied for user ... to database ... The file tries to create or use another database In a copy of the file, remove the CREATE DATABASE and USE lines
#1227 - Access denied; you need (at least one of) the SUPER privilege(s) The file contains a statement reserved for the server administrator, often a DEFINER clause Remove the DEFINER=... clause from views, triggers and routines, or export again without those objects
#1050 - Table '...' already exists The destination database already contains these tables After a safety export, empty the database or use a file with DROP TABLE
#1062 - Duplicate entry '...' for key ... The data already exists, often after a partial import Start again from an empty database, or resume the import at the right point
#1064 - You have an error in your SQL syntax Truncated or edited file, or syntax from another version Export again and compare MySQL or MariaDB versions. The line quoted in the error shows where to look
#1273 - Unknown collation: 'utf8mb4_0900_ai_ci' Export made on a newer MySQL version In a copy of the file, replace this collation with an available one, such as utf8mb4_unicode_ci
#1153 - Got a packet bigger than 'max_allowed_packet' bytes A query is too long for the server Export again in Custom mode with a lower Maximal length of created query
You probably tried to upload a file that is too large Upload limit exceeded Compress the file or use Import Dump
Script timeout passed or 504 Gateway Timeout The import took too long Resubmit the same file to resume, or use Import Dump
Garbled accents after the import Wrong character set at import Restore your safety export, then import again with the right encoding
The site shows a database connection error Incorrect connection settings Check the database name, user, password and host in the site configuration

Further reading