Skip to content
BasiX Media

Databases

A managed MySQL database alongside your files.

On this page

Managed MariaDB and PostgreSQL databases alongside your files. Create them in Dashboard → Databases.

  • Host: db.basix.media. Port 3306 (MariaDB) or 5432 (PostgreSQL). Connect with TLS: the connection string from the dashboard enables it.
  • The dashboard shows the user, password and a ready connection string.
  • Database size counts toward your storage quota. Over quota, databases switch to read-only until you free space.
  • In the dashboard you can restrict access to a list of IP addresses and cap connections and queries, import or export a SQL dump, and migrate from another server.

Connect to it

Use the connection string from Dashboard → Databases → your database. Store it in an environment variable, never in code.

DATABASE_URL="mysql://user:[email protected]:3306/my_app?ssl=true"

PostgreSQL databases work the same way with pg/psycopg2/pdo_pgsql and a postgres://... connection string.

Access rules through the API

GET or PATCH https://upload.basix.media/api/v1/databases/<id>/access. Needs a full key created by an owner or an admin of the team. The database id is shown in the dashboard URL (/dashboard/databases/<id>).

FieldMeaning
allowedIpsUp to 50 IPv4/IPv6 addresses or CIDR ranges. Empty list = open to any address. MariaDB accepts single IPv6 addresses only, no IPv6 ranges.
maxConnectionsSimultaneous connections, 1 to 1,000,000, or null for no limit.
maxQueriesPerHourMariaDB only. 1 to 1,000,000 or null.
maxConnectionsPerHourMariaDB only. 1 to 1,000,000 or null.
curl
curl -X PATCH https://upload.basix.media/api/v1/databases/<id>/access \
  -H "Authorization: Bearer $BASIX_FULL_KEY" -H "Content-Type: application/json" \
  -d '{ "allowedIps": ["203.0.113.10", "198.51.100.0/24"], "maxConnections": 50 }'

Both methods answer { "access": { "allowedIps": [...], "maxConnections": 50, "maxQueriesPerHour": null, "maxConnectionsPerHour": null } }. Fields you leave out keep their value. An invalid value answers 400 BAD_REQUEST with the reason.

Try it on your own server

Create a free account and your API key is ready in about two minutes. 3 GB included, bandwidth never billed, no card needed.

Create a free account
Databases — Standalone docs — BasiX