Skip to main content
The database endpoints allow you to manage MySQL/MariaDB databases for your servers.

List Databases

Get all databases for a server.
curl -X GET "https://panel.example.com/api/client/servers/{server}/databases" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
server
string
required
The server identifier

Response

{
  "object": "list",
  "data": [
    {
      "object": "server_database",
      "attributes": {
        "id": "jvKWQqgd",
        "host": {
          "address": "mysql.example.com",
          "port": 3306
        },
        "name": "s5_minecraft",
        "username": "u5_xK8mN2pQ",
        "connections_from": "%",
        "max_connections": 0
      }
    }
  ]
}
id
string
Hashed database identifier
host
object
Database host connection details
host.address
string
Database server hostname or IP address
host.port
integer
Database server port
name
string
Database name
username
string
Database username for authentication
connections_from
string
IP address or wildcard (%) for allowed connections
max_connections
integer
Maximum concurrent connections (0 = unlimited)

Create Database

Create a new database for the server.
curl -X POST "https://panel.example.com/api/client/servers/{server}/databases" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "database": "minecraft",
    "remote": "%"
  }'
database
string
required
Database name (will be prefixed with server identifier)
remote
string
required
IP address or % wildcard for allowed connections

Response

{
  "object": "server_database",
  "attributes": {
    "id": "jvKWQqgd",
    "host": {
      "address": "mysql.example.com",
      "port": 3306
    },
    "name": "s5_minecraft",
    "username": "u5_xK8mN2pQ",
    "connections_from": "%",
    "max_connections": 0,
    "relationships": {
      "password": {
        "object": "database_password",
        "attributes": {
          "password": "aB3$kL9mN2pQ5rT8"
        }
      }
    }
  }
}
relationships.password
object
Database password (only included on creation)
The database password is only returned when the database is first created. Store it securely - it cannot be retrieved again, only rotated.

Rotate Database Password

Generate a new random password for a database.
curl -X POST "https://panel.example.com/api/client/servers/{server}/databases/{database}/rotate-password" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
server
string
required
The server identifier
database
string
required
The database identifier (hashed ID from list)

Response

{
  "object": "server_database",
  "attributes": {
    "id": "jvKWQqgd",
    "host": {
      "address": "mysql.example.com",
      "port": 3306
    },
    "name": "s5_minecraft",
    "username": "u5_xK8mN2pQ",
    "connections_from": "%",
    "max_connections": 0,
    "relationships": {
      "password": {
        "object": "database_password",
        "attributes": {
          "password": "nW7$pM4kL2qR9tY6"
        }
      }
    }
  }
}
Rotating the password will immediately invalidate the old password. Update your application’s database configuration before rotating.

Delete Database

Delete a database and its user.
curl -X DELETE "https://panel.example.com/api/client/servers/{server}/databases/{database}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
server
string
required
The server identifier
database
string
required
The database identifier (hashed ID from list)

Response

Returns 204 No Content on success.
Deleting a database is permanent and cannot be undone. All data in the database will be lost.

Database Limits

The number of databases you can create is limited by your server’s database_limit configuration. You can view this limit in the server details:
{
  "feature_limits": {
    "databases": 5,
    "allocations": 1,
    "backups": 3
  }
}
If you’ve reached the limit, you’ll receive an error when attempting to create a new database:
{
  "errors": [
    {
      "code": "TooManyDatabasesException",
      "status": "400",
      "detail": "This server has reached its limit of 5 databases."
    }
  ]
}

Connection Examples

Using MySQL Command Line

mysql -h mysql.example.com -P 3306 -u u5_xK8mN2pQ -p s5_minecraft

Using Connection String

mysql://u5_xK8mN2pQ:[email protected]:3306/s5_minecraft

PHP PDO Example

$dsn = "mysql:host=mysql.example.com;port=3306;dbname=s5_minecraft";
$username = "u5_xK8mN2pQ";
$password = "aB3$kL9mN2pQ5rT8";

try {
    $pdo = new PDO($dsn, $username, $password);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    echo "Connection failed: " . $e->getMessage();
}

Node.js Example

const mysql = require('mysql2');

const connection = mysql.createConnection({
  host: 'mysql.example.com',
  port: 3306,
  user: 'u5_xK8mN2pQ',
  password: 'aB3$kL9mN2pQ5rT8',
  database: 's5_minecraft'
});

connection.connect((err) => {
  if (err) {
    console.error('Error connecting:', err);
    return;
  }
  console.log('Connected to database');
});

Build docs developers (and LLMs) love