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
SELECTonly 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 (or the PostgreSQL guide).
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 if you run into issues.