Databases
A managed database runs as its own deployment, with credentials, a data manager and backups included.
Updated Dec 1, 2026Create a database
- Click New deployment, then pick Database.
- Keep New database, choose the Engine and its Version.
- Give it a name, choose its resources and click Launch deployment.
| Engine | Versions | Default user |
|---|---|---|
| MySQL (runs MariaDB) | 11.4, 10.6, 10.3 | root |
| PostgreSQL | 18, 17, 16, 14 | postgres |
| MongoDB | 8, 7, 6 | admin |
| Redis | 8, 7, 6 | none, password only |
The password is generated for you at creation. A database counts as one deployment of your plan, like a bot.
A small bot often does fine with SQLite, a single file inside the bot's own files, with no extra deployment. You can browse it from the Files tab with Open in SQLite viewer. See Files.
The Database tab
The Database tab holds the Connection details. It needs the Manage permission.
- Host and Port, the address of the database.
- Username (or Root password for MySQL) and Password, hidden until you click Show.
- Connection URI, a ready-made URL for your driver, with a toggle to show or hide the password inside it.
Every value has a copy button.
Connect your bot
Store the URI as a Secret environment variable in your bot deployment, for example DATABASE_URL, then read it in your code. See Environment Variables.
PostgreSQL
import pg from 'pg';
const db = new pg.Pool({ connectionString: process.env.DATABASE_URL });
MySQL
import mysql from 'mysql2/promise';
const db = await mysql.createConnection(process.env.DATABASE_URL);
MongoDB
import { MongoClient } from 'mongodb';
const client = new MongoClient(process.env.DATABASE_URL);
Redis
import os, redis
r = redis.from_url(os.environ["DATABASE_URL"])
The database accepts connections from the internet on its host and port, so you can also reach it from your computer with a client such as DBeaver, TablePlus, MongoDB Compass or redis-cli. Keep the password secret.
The Data tab
The Data tab opens the Database manager in your browser. It needs the Databases permission, and the database must be running.
SQL databases and MongoDB
- Pick the Database at the top, then a table (or collection) in Tables. Filter tables finds one quickly.
- Data shows the rows, page by page. Search rows, click a cell to edit it, Insert a row, or select rows and delete them. Editing and deleting need a primary key on the table.
- Structure shows the columns with their type, nullable flag, default and keys.
- Query opens the Query editor. Write a query and run it, see the rows or the number of affected rows, and reopen past queries in History.
- Info shows the row count, size, columns and indexes.
- For MongoDB, Shell opens a Mongo shell.
Redis
Redis has its own manager. Type a key pattern (for example user:*) and click Scan to list keys with their TTL. Click a key to see and edit its value, use New key to add one with an optional TTL, and run any Redis command (GET, HGETALL, TTL, HSET...) from the command bar.
Import and export
Import / Export moves data in and out with standard dump files.
| Engine | Import accepts | Export gives |
|---|---|---|
| MySQL | .sql or .sql.gz (mysqldump) |
A SQL dump |
| PostgreSQL | .sql, .sql.gz or .dump (pg_dump) |
A pg_dump file |
| MongoDB | .archive, .archive.gz or a tarred dump directory (mongodump) |
A mongodump archive |
| Redis | dump.rdb, optionally gzipped |
A snapshot of the whole keyspace |
- Download dump exports the data, to keep or to load on another host.
- To import, choose a dump file and the target database (Pick an existing one or Create a new one). Check Wipe the target before restoring to replace its content. Otherwise the dump is merged into what is there.
- A MongoDB archive restores into the database names it carries.
- A Redis import always replaces the whole keyspace. The engine stops, the snapshot is swapped in, and it starts again.
The import file can be up to 500 MB, and never more than the storage of the deployment.
Regenerate the password
In the Database tab, click Regenerate password, then Generate a new password. The database restarts to apply it, which can take up to 2 minutes. Apps that still use the old password lose access until you update them, so change your environment variable right after. If the database is stopped, the new password takes effect at its next start.
Change the engine or version
The Startup tab lets you change the engine or the version. Both reinstall the database and reset the data. Export a dump first, then import it after the change. See Startup.
Backups
Databases are backed up automatically like every deployment, see Backups. For a copy you can open anywhere, use Download dump.
Troubleshooting
- Could not reach the database. Make sure the database deployment is running. The panel connects to the port shown on the Database tab.
- Access denied or authentication failed in your bot. The password changed or is copied wrong. Copy the URI again from the Database tab.
- The database stops on its own. It may be out of memory. Give it more RAM in Settings and Resources.