Skip to main content
Before creating a database, you first create a database user. Your apps sign in with this user.

Supported types

Creating a user

Open Databases and select Create Database User. Three steps guide you through it:
  1. Engine: MySQL, PostgreSQL or Redis.
  2. Credentials: a username and a password. Generate creates a strong password and copies it.
  3. Review: check the details and create the user.
When the user is ready, you can go straight to creating a database for it. The username is automatically prefixed with your workspace prefix.

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:
The password is hidden until you select Show, and Copy copies the full URL. Use it as your app’s 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.
If you write a connection URL yourself, URL-encode special characters in the password: for example # becomes %23 and @ becomes %40. An unencoded # cuts the URL short and the app cannot connect.
Deleting a database user is destructive. Delete its databases first. The dashboard requires explicit confirmation.

Isolation

Each user can only reach its own databases. A user cannot connect to, or read from, another customer’s databases.