Supported types
Creating a user
Open Databases and select Create Database User. Three steps guide you through it:- Engine: MySQL, PostgreSQL or Redis.
- Credentials: a username and a password. Generate creates a strong password and copies it.
- Review: check the details and create the user.
Password rules
The password must have:- at least 8 characters
- uppercase letters
- lowercase letters
- at least one number
Quota
The number of database users you can create depends on your plan and add-ons. MySQL, PostgreSQL and Redis users share the same limit.Ongoing management
From the Database Users table you can:- reveal the password
- change the password (for Redis, open connections that used the old password are closed)
- delete the user
Connection URL
In the Databases table, select the link icon on a database to see its host, port, database name and user, and a ready-made connection URL, for example:DATABASE_URL. The username and password are already encoded for use in a URL.
Connect a database to an app
In the Databases table, select the plug icon on a database, choose an app from your workspace and select Connect. Servbase adds these variables to the app:
For Redis the names are
REDIS_URL, REDIS_HOST, REDIS_PORT, REDIS_USER and REDIS_PASSWORD. Variables with the same names are replaced.
To connect one app to more than one database, set a prefix: with ANALYTICS the variables become ANALYTICS_DATABASE_URL, ANALYTICS_DB_HOST and so on. Redeploy or restart the app so it reads them. To disconnect, delete the variables in the app’s settings.
