Plesk

Create and manage MySQL databases in Plesk with phpMyAdmin

Create a MySQL or MariaDB database and user in Plesk, open phpMyAdmin, import and export SQL dumps, allow remote access and repair tables.

BeginnerPlesk3 min read

Most PHP applications such as WordPress, Joomla or WHMCS need a MySQL or MariaDB database. Plesk lets you create the database and its user together, then manage the data in phpMyAdmin. This guide walks through the full lifecycle, from creation to import, export and remote access.

Before you start

  • A Plesk subscription that allows databases (check Account → Resources or the subscription overview).
  • A strong password ready for the database user.
  • If you are importing, an .sql or .sql.gz dump from the old host.

Create a database

  1. Log in to Plesk and go to Websites & Domains → Databases (or Databases in the left menu).
  2. Click Add Database.
  3. Enter a Database name. Plesk may add a prefix such as the subscription name; note the full name.
  4. Choose the Database server (usually localhost:3306) and the Related site.
  5. Tick Create a database user, enter a user name and click Generate for a strong password.
  6. Leave User has access to all databases within the selected subscription unticked unless you need it.
  7. Click OK.

Use these values in your application: host localhost, the database name, the user name and the password.

Open phpMyAdmin

On the Databases page, click phpMyAdmin under the database. Plesk logs you in automatically, so you never need the password for this step. From here you can browse tables, run SQL queries and change data.

Import a database

  1. On the Databases page, click Import Dump under the database.
  2. Upload the .sql, .zip or .gz file, or pick one you already uploaded with the File Manager.
  3. Optionally tick Recreate the database to empty it first.
  4. Click OK.

Plesk's Import Dump handles much larger files than phpMyAdmin's web import, which is limited by PHP upload size. For dumps over 1 GB, ask for SSH access and import with mysql on the command line.

Export a database

  • Click Export Dump under the database, choose a location in the subscription and tick Automatically download dump after creation.
  • Alternatively, open phpMyAdmin, select the database, click Export, choose Quick and SQL, then Export.

Manage users and permissions

Click User Management on the Databases page to add extra users or change passwords. Each user can be given read-only or read and write roles. Changing the password here means you must also update your application's configuration file, for example wp-config.php.

Allow remote access

  1. Open User Management and click the user.
  2. Under Access control, choose Allow remote connections from and enter specific IP addresses rather than Any host.
  3. Make sure port 3306 is open in the server firewall for those IPs (administrator task).
  4. Check and repair

    Click Check and Repair under the database. Plesk runs a table check and offers to repair corrupted MyISAM or InnoDB tables, which often fixes "table is marked as crashed" errors.

    Troubleshooting

    • Error establishing a database connection: verify the database name with its prefix, the user and the password in your application, and that the host is localhost.
    • Access denied for user: the user is not assigned to that database. Edit the user and pick the right database.
    • Import fails with "MySQL server has gone away": the dump is too large for the current packet limit. Split it or import over SSH.
    • Unknown collation utf8mb4_0900_ai_ci: the dump came from MySQL 8 and your server runs MariaDB. Replace the collation with utf8mb4_unicode_ci in the dump.

    Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.