Test MySQL connection (raw credentials)
POST
/connections/test-connection
const url = 'https://api.reflexdb.cloud/v1/connections/test-connection';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"backend":"mysql","mysqlHost":"example","mysqlPort":1,"mysqlUser":"example","mysqlPassword":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.reflexdb.cloud/v1/connections/test-connection \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "backend": "mysql", "mysqlHost": "example", "mysqlPort": 1, "mysqlUser": "example", "mysqlPassword": "example" }'Verifies connectivity to a MySQL server using credentials provided in the request body. Also discovers available schemas. Use this before creating a connection.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
TestConnectionBody
Raw credentials for testing a database connection before saving it
object
backend
Source database engine
string
mysqlHost
required
string
mysqlPort
integer
mysqlUser
required
string
mysqlPassword
required
string
Responses
Section titled “ Responses ”Result of a MySQL connectivity test
Media type application/json
TestConnectionResult
Result of a MySQL connectivity test
object
ok
required
boolean
error
Error message (present when ok is false)
string
latencyMs
Round-trip ping latency in milliseconds
number
estimatedSizeGb
Estimated source DB size in GB (data + index). Omitted if the query fails or the user lacks privileges.
number
availableSchemas
MySQL databases visible to this user, excluding system schemas
Array<string>
binlog
Binlog CDC readiness check
object
logBin
required
boolean
format
required
string
serverId
required
integer
ready
required
True when log_bin=ON and binlog_format=ROW
boolean
issues
required
Array<string>
Example generated
{ "ok": true, "error": "example", "latencyMs": 1, "estimatedSizeGb": 1, "availableSchemas": [ "example" ], "binlog": { "logBin": true, "format": "example", "serverId": 1, "ready": true, "issues": [ "example" ] }}Default Response
Media type application/json
Error
object
error
required
string
message
string
Example generated
{ "error": "example", "message": "example"}