Database Services
Database Services
Ploi Cloud makes it easy to add database services to your applications. Supported databases include MySQL, PostgreSQL, and MongoDB.
Adding a Database
-
Navigate to your application
-
Click "Add Service"
-
Select your database type
-
Choose a database version:
- MySQL: 8.4, 8.0, 5.7
- PostgreSQL: 16, 15, 14, 13
- MongoDB: 7.0, 6.0, 5.0
-
Configure the resources:
- CPU: Select from available plans
- Memory: Configurable based on your needs
- Storage Size: Set during creation (cannot be changed later)
-
Click "Create database"
Connection Details
Database credentials are automatically generated and injected as environment variables into your application:
MySQL
For Laravel applications:
DB_CONNECTION- Set to 'mysql'DB_HOST- Database hostnameDB_PORT- Port 3306DB_DATABASE- Database nameDB_USERNAME- Database usernameDB_PASSWORD- Database password
For WordPress applications:
WORDPRESS_DB_HOST- Database hostnameWORDPRESS_DB_NAME- Database nameWORDPRESS_DB_USER- Database usernameWORDPRESS_DB_PASSWORD- Database password
PostgreSQL
For Laravel applications:
DB_CONNECTION- Set to 'pgsql'DB_HOST/POSTGRES_HOST- Database hostnameDB_PORT/POSTGRES_PORT- Port 5432DB_DATABASE/POSTGRES_DB- Database nameDB_USERNAME/POSTGRES_USER- Database usernameDB_PASSWORD/POSTGRES_PASSWORD- Database passwordPOSTGRESQL_URL/POSTGRES_URL- Full connection string
For WordPress applications:
WORDPRESS_DB_HOST- Database hostnameWORDPRESS_DB_NAME- Database nameWORDPRESS_DB_USER- Database usernameWORDPRESS_DB_PASSWORD- Database password
MongoDB
MONGODB_URI- Full connection string with authenticationMONGODB_HOST- Database hostnameMONGODB_PORT- Port 27017MONGODB_DATABASE- Database nameMONGODB_USERNAME- Database usernameMONGODB_PASSWORD- Database password
Backups
The platform performs automatic nightly backups of all applications and their databases. Backups can be restored to create a new copy of your application with all its data.
Root credentials
When you create a database service, root credentials are generated automatically. These give you full administrative access to your database and allow you to create additional databases or users if needed.
Viewing root credentials
To view your root credentials:
- Navigate to your application
- Click on your database service
- Click "Environment variables"
- Scroll to the "Root credentials" section
You'll see the username and password for the root/superuser account.
Important notes
- These credentials are NOT auto-injected into your application
- If you want to use them, you must manually add them to your application secrets
- Root credentials provide full database privileges
Managing Databases
To manage your database:
- Go to the service in your application
- View service logs to monitor database activity
- Restart the service if needed
- Enable debug access for temporary external connections
Note: Storage size cannot be changed after creation. Plan your storage needs accordingly.