---
title: "How do I create a database and database user?"
url: "https://ploi.io/documentation/database/how-do-i-create-a-database-and-database-user"
published: "2026-06-15"
last_updated: "2026-06-15"
---

# How do I create a database and database user?

Ploi lets you create databases and database users directly from the panel. Depending on your server type this manages MySQL, MariaDB or PostgreSQL.

Creating a database
-------------------

Open your server and go to the **Databases** section, then add a database. You provide:

- **Name** — the database name (2–64 characters; letters, numbers and underscores).
- **User** (optional) — create a database user at the same time. Leave it empty to create just the database.
- **Password** (optional) — the password for that user. Ploi can generate a strong one for you.
- **Read-only** — if enabled, the user is granted `SELECT` only instead of full privileges.
- **Description** — an optional note.

Ploi creates the database (and user, if provided) on the server and grants the appropriate privileges. Passwords are stored encrypted.

Adding more users
-----------------

A database user can be reused across multiple databases. From the Databases section you can create a new user with a password, or assign an existing user to another database.

For MySQL/MariaDB, users connect from `127.0.0.1` by default. To connect from another machine, create the user with remote access enabled and set the allowed IP — see [How do I allow remote access to MySQL or MariaDB](https://ploi.io/documentation/database/how-do-i-allow-remote-access-to-mysql-or-mariadb) (or the [PostgreSQL guide](https://ploi.io/documentation/database/how-to-allow-remote-access-to-postgresql)).

Connecting from your application
--------------------------------

Use `127.0.0.1` (not `localhost`) as the host in your application's configuration. See [My application cannot connect to the MySQL server](https://ploi.io/documentation/database/my-application-cannot-connect-to-the-mysql-server) if you run into issues.