Working with database in Plesk

You can create and remove databases in Websites & Domains > Databases.

You can create a database by specifying its name. If your subscription grants you the corresponding permission, you can choose a database type and the database server on which the database should be created.

You can select a website on which the database will be used in the Related site box. This is convenient if you have a lot of sites and databases, because you will see which database is used by which site right on the Databases page.

Database Users

A database must have at least one user account associated with it. Otherwise, it will be impossible to access the database. You can create a database user while creating a database by selecting the Create a database user checkbox.

How to Remove a Database

To remove a database, click the link Remove Database under this database in Websites & Domains > Databases. Note that you can remove only the databases and database users that are not used by installed APS apps. If the link is not available, it means that this database is used by an application and you can remove it only by removing the respective application.

Backing Up and Restoring Databases

You can back up a database in the following ways:

  • Export a database dump in the SQL format. This enables you to create and download the database in a single file. An individual file can be restored into the same or another database. See the Exporting and Importing Database Dumps section for details.
  • Back up an entire subscription. This enables you to create a backup file in a selected storage (on the Plesk server or on a remote FTP server). When restoring the backup, you can select a database to restore. See the Backing Up and Recovering Websites section for details.

You can restore a database either from a subscription backup archive or from an SQL dump file in the following ways:

  • Import a database dump. This enables you to restore data from a file in the SQL format. Individual dumps can be restored into any database of the same type as the type of a dump (for example, MySQL).
  • Restore a database from a backup of an entire subscription. When restoring the backup, you can select an individual database to restore.

Exporting and Importing Database Dumps

In Plesk, to export a database dump  means to save a source database in a file, which then can be used for storage or distribution. To import a database dump  means to restore data from such a file to a destination database. You can import a database to the same or another database server. The only restriction is that the source and destination databases must be of the same type.

To save a copy of a database:

  1. Go to Websites & Domains > Databases > Export Dump in the database tools pane.
  2. Save a dump:
    1. To save a dump in a certain directory on the server, select the directory. The home directory of your subscription is used by default.
    1. To save a dump on your local computer as well as on the server, select Automatically download dump after creation.

To deploy your copy of a database in Plesk:

  1. Go to Websites & Domains > Databases > Import Dump in the database tools pane.
  2. Select a dump to deploy:
    1. To deploy a dump from your local computer, select Upload and click Browse. Then select the ZIP archive containing the dump file.
    1. To deploy a dump from a directory on the server, select Import and select the dump file.

To deploy the dump into a newly created database, select Recreate the database. The old database will be deleted and a new one, with the same name, created.

Was this article helpful?