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"
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
}
}
]
}
Hashed database identifier
Database host connection details
Database server hostname or IP address
Database username for authentication
IP address or wildcard (%) for allowed connections
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 name (will be prefixed with server identifier)
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"
}
}
}
}
}
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"
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"
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
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');
});