Skip to main content
Your hosted database sits on a private network: your app reaches it, the internet does not. External access gives one outside system (your own backend on another cloud, a BI tool, a migration script) its own credential to reach that database through Meridian’s database gateway at db.the-meridian.app, on port 3306 for MySQL and 5432 for PostgreSQL. External access is included with the Pro and Enterprise plans. On Lite, the page offers a plan change instead. If an app moves to Lite, or its plan lapses, its credentials are paused rather than revoked: they stop connecting, live connections close within about a minute, and nothing new can be created or rotated. You can still edit and revoke them. Moving back to Pro or Enterprise makes them work again within about ten minutes, with nothing to reissue.
If the other system only needs your data, expose an HTTPS endpoint on your hosted app and call that instead. Your app keeps control of what is read and written, and the database stays private.

How a credential works

A credential has two parts, and a connection needs both:
  • A client certificate signed by Meridian’s private certificate authority. Its private key is generated in your browser when you create the credential, and only the public key is sent to Meridian. Meridian never sees or stores the private key.
  • A database user and password that work on this one database only. The password is shown once and Meridian keeps no copy, only the database’s own hash of it.
The gateway admits a connection only when the certificate is the credential’s current one, the user and database are the credential’s own, and the connection comes from an allowed network. Everything else about access is enforced by the database’s own grants on that one user. Each credential is one of two access modes:
  • Read-only: SELECT and SHOW VIEW on the database. Right for reporting, BI tools and anything that only reads.
  • Read-write: everything your app itself can do on the database, including changing and deleting data and tables. Give it only to a system you trust. On PostgreSQL a read-write session runs as your app’s own role, so tables it creates belong to your app and your app can use them.
External access works for MySQL and PostgreSQL databases that are ready. If the External access page says it is not available, the database is still provisioning, or external access is not yet switched on for the platform.

Creating a credential

  1. Open Hosting → Database → External access and select New credential.
  2. Give it a label named after the system that connects (aws-backend, metabase). Letters, digits, spaces, _, . and -, up to 64 characters.
  3. Pick Read-only or Read-write.
  4. Optionally list allowed networks, one per line, such as your backend’s NAT egress address as 203.0.113.7/32. Leave it empty to allow any network.
  5. Set Connections: how many connections this credential may open at once. A database’s credentials share 10 connections between them, and the field shows how many are free. It starts at 5, or at what is left if that is less.
  6. Select Create credential. Your browser generates the key pair, sends the public key, and receives the certificate and password.
The next screen shows the host, port, database, user, password and DATABASE_URL once. Select Download bundle to save a ZIP with: The screen cannot be closed until you confirm you saved the bundle. The private key exists only in that bundle: close the screen without it and the credential cannot connect, so rotate it to get a new one. Store the files the way you store other production secrets (AWS Secrets Manager, Google Secret Manager, Vault, or your platform’s equivalent).

Connecting

Every connection uses TLS 1.2 or later with the client certificate, and verifies the gateway’s server certificate against ca.pem for the name db.the-meridian.app. Connect by that name, not by IP address, or the server name check fails.

Prisma

Prisma reads the client certificate and key from one PKCS#12 file. Create it once, choosing its password:
Use OpenSSL 3 with its defaults. A file exported with -legacy cannot be read by Prisma 6. Then set DATABASE_URL with the TLS parameters. sslcert is the CA that verifies the server, sslidentity is your client identity, and both paths are relative to the folder of schema.prisma:

Node.js (mysql2)

Keep the pool at or below the credential’s connections (5 unless you changed it).

Go (go-sql-driver/mysql)

Register a TLS config with the CA and the client certificate, then name it in the DSN:

Python (PyMySQL)

Java (JDBC)

MySQL Connector/J reads the client identity and the CA from key stores. Create both once:
Then connect with sslMode=VERIFY_IDENTITY:
The URL is one line, wrapped here to read. Pass the user and password as the connection’s user and password properties.

Laravel (PDO)

Point the mysql connection in config/database.php at the three files. Use absolute paths, since PHP resolves relative ones from the working directory:

mysql CLI

--ssl-mode is the MySQL client’s option. The MariaDB client uses --ssl-verify-server-cert with the same three file options.

Connecting to PostgreSQL

A PostgreSQL credential connects to db.the-meridian.app:5432. The user is ext_... and is shown as the Database user on the page. The bundle’s README.txt and .env carry the same values for PostgreSQL as for MySQL. The gateway speaks the PostgreSQL protocol: it takes the client’s SSLRequest, runs TLS with your client certificate, and then the database’s own password login (SCRAM) happens inside TLS. Use sslmode=verify-full so the client checks the server certificate chain and the name db.the-meridian.app. Notes that apply to every PostgreSQL client:
  • Cancelling a running query needs a client that sends the cancel request over TLS: libpq 17 or newer through its PQcancelBlocking / PQcancelStart calls, or a driver built on them. Ctrl-C in psql (any version, 18 included) still sends it unencrypted, and the gateway drops it, so the query runs on. Set statement_timeout on the server side instead (SET statement_timeout = '30s'), or end the query from another connection with pg_cancel_backend.
  • channel_binding=require is not supported. The gateway terminates TLS, so the client cannot bind its login to the TLS session. Leave channel_binding at its default (prefer) or disable.
  • Set sslmode=verify-full. require and verify-ca do not check the server name.

Connection URL (libpq)

Most libpq-based tools take this URL as is, including pg_dump, pg_restore and psql. Give the key file owner-only permissions (chmod 600 client.key), or libpq refuses it.

psql

Prisma (PostgreSQL)

Prisma reads the client certificate and key from one PKCS#12 file. Create it, and choose a password for it when asked:
Here sslcert is the CA file, as in the MySQL form above. Paths are relative to the folder of schema.prisma.

Node.js (node-postgres)

Python (psycopg)

Managing credentials

The External access page lists every credential with its label, database user, access mode, status, when and from which address it last connected, when its certificate expires, and who created it. A credential’s status is one of:
  • Active: it can connect.
  • Locked: it had 10 failed logins within 15 minutes. New connections are refused, while connections already open keep running. It unlocks by itself after 15 minutes, and rotating unlocks it at once. Everyone with access to the app gets a notification when a credential locks.
  • Expired: its certificate is past its one-year lifetime. Rotate it to issue a new one.
  • Revoked: it no longer works, and is kept in the list for the record.
From a credential’s menu:
  • Edit changes the label, the allowed networks and the credential’s connections. New connections see the change within 30 seconds. Lowering the connections leaves connections already open running; new ones are refused until the count drops under the new limit.
  • Rotate issues a new certificate and a new password, with a new private key generated in your browser, and shows them once, like a new credential. The old certificate and password stop working at once, and connections opened with them are closed, so update the system that uses them straight away. Rotate before the certificate expires, and whenever a file of the bundle may have leaked.
  • Revoke deletes the credential’s database user. Connections using it stop within 30 seconds. This cannot be undone: create a new credential if the system needs access again.
Deleting the database revokes all of its credentials.

Recent connections and usage

The history button on a credential’s row shows its last 100 connections and failed logins from the past 30 days: when, from which address, how long each connection lasted and how much it sent to your backend. Anyone who can see the app’s hosting can open it. What the database sends to your backend through the gateway counts towards the app’s monthly outbound bandwidth, like any other response your app serves.

Who can do it

The whole page, the list of credentials and their connection history included, also asks you to confirm it’s you (your password, your passkey or an authenticator code) when you open it, and nothing of it loads until you do. Once confirmed, creating, editing, rotating and revoking ask nothing more, until 15 minutes pass without using the database pages, or you refresh the page or open it in a new tab. If the page locks while a credential is being created or rotated, or while its password is on screen, the new password and bundle wait, and show as soon as you confirm it’s you again. The CLI lists and revokes credentials without the confirmation, so you can still find and revoke a leaked credential from a terminal. No role can read a password or private key back after the one-time screen. Creating, editing, rotating and revoking a credential are each recorded in the organization audit log. See Customer permissions and Roles.

Troubleshooting

Access denied: “This client certificate is not a current Meridian credential”. The certificate was rotated or revoked, it has expired, or the app’s plan no longer includes external access. Check the credential’s status and the app’s plan. The connection closes during or right after the TLS handshake. The gateway did not accept the certificate. It was rotated, revoked or has expired, or the client is presenting a different certificate than the one in this credential’s bundle. Check the credential’s status, and rotate it to get a fresh bundle if the files are lost or out of date. Check too that the client verifies against ca.pem and connects to db.the-meridian.app by name. Access denied when logging in. The password is wrong, or the credential is locked after 10 failed logins. A locked credential shows Locked on the page: wait 15 minutes, or rotate it to unlock it at once with a new password. Check that the user and database are the credential’s own, exactly as in .env. A different database name is refused. The connection is refused from one machine and works from another. The source address is not in the credential’s allowed networks. The address the gateway sees is your network’s public egress address (a NAT gateway or load balancer), not the machine’s private IP. The page shows the last address that connected. Add the right network with Edit. On MySQL, USE otherdb or a query on another database is refused. A credential reaches its own database only. Switching to another database at the protocol level closes the connection (error 1047), and a query that names another database is refused by MySQL. USE of your own database works, so drivers that select the database again on reconnect are fine. Connect with the database name from .env. Too many connections. A credential allows only its share of the database’s 10 connections, 5 by default. Cap your connection pool at that number, or move connections to it from another credential with Edit. PostgreSQL: Ctrl-C or a timeout does nothing, or the cancel fails. The gateway accepts only cancel requests sent over TLS. Ctrl-C in psql sends them unencrypted, in every version, and older drivers do too. Use a server-side statement_timeout, a driver on libpq 17 or newer that cancels over TLS, or end the query from another connection with pg_cancel_backend (or the session with pg_terminate_backend). PostgreSQL: channel binding is required, but not supported. Remove channel_binding=require from the connection string. The gateway does not support it. PostgreSQL: SSL error: certificate verify failed. The client is not using sslmode=verify-full with sslrootcert=ca.pem, or it connects by IP address instead of db.the-meridian.app.
Last modified on November 13, 2026