> ## Documentation Index
> Fetch the complete documentation index at: https://docs.digitalfyre.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating a MySQL or PostgreSQL Database

Plesk supports both MySQL and PostgreSQL databases. You can create and manage databases directly from the Plesk dashboard.

## Creating a Database

<Steps>
  <Step title="Go to Databases">
    Log in to Plesk and click **Databases** in the left sidebar.
  </Step>

  <Step title="Add a Database">
    Click **Add Database**.
  </Step>

  <Step title="Fill in the Details">
    * **Database name** — enter a name for your database
    * **Database type** — select **MySQL** or **PostgreSQL**
    * **Related site** — select the domain this database is associated with
  </Step>

  <Step title="Create a Database User">
    Under **Add a new database user**, enter a username and a strong password. This user will be used by your application to connect to the database.
  </Step>

  <Step title="Confirm">
    Click **OK**. The database and user are created.
  </Step>
</Steps>

## Connection Details

Use the following details to connect your application to the database:

| Setting             | Value            |
| ------------------- | ---------------- |
| **Host**            | `localhost`      |
| **Database name**   | As entered above |
| **Username**        | As entered above |
| **Password**        | As entered above |
| **MySQL Port**      | `3306`           |
| **PostgreSQL Port** | `5432`           |

<Info>
  Always use `localhost` as the database host when connecting from an application on the same hosting account. External database connections are not permitted on shared hosting.
</Info>
