Browse docs
Cloud docs
Connecting to MariaDB on Layerbase Cloud
MariaDB instances use the MySQL-compatible protocol, making them easy to drop into existing MySQL and MariaDB applications.
Best for: MariaDB-native features, MySQL-compatible apps, and teams moving workloads off hosted MariaDB services.
Open your database in the dashboard
Go to /cloud, click the database you just created, and the connection panel shows the host, port, username, password, and a ready-to-paste connection string for the engine.
Copy the connection string from Quick Connect, including the generated password and database name.
You can also download the whole set instead of copying values one at a time: the Connect dialog offers a Download .env file, ready to drop into a project under the environment variable your engine's clients expect, and a Download .txt with the labeled parameters. Both files contain the password in plain text, so keep them out of version control.
TLS is required, on by default
Enable TLS in your client, usually with --ssl or ssl: true. For strict certificate verification, use --ssl --ssl-verify-server-cert against the direct endpoint (pooler port toggle off in the Connect dialog).
MySQL-compatible wire protocol on the allocated TLS port
Use any standard client
MariaDB works with the normal client family for that engine. Start with the dashboard snippet, then move the same URL and credentials into your app environment.
If your client has separate direct, pooled, TLS, or HTTP options, prefer the exact variant shown in Quick Connect.
mariadb --ssl --host your-host.cloud.layerbase.dev --port <port> --user layerbase --password appMariaDB notes
- Each database gets its own allocated TLS port, shown in Quick Connect. There is no shared 3306 port, so copy the exact port from the dashboard.
- Connections run through a ProxySQL pooler and require TLS. Most MySQL drivers work against MariaDB without code changes.
- Strict certificate verification (--ssl-verify-server-cert for the mariadb CLI, --ssl-mode=VERIFY_IDENTITY for the mysql CLI, or rejectUnauthorized: true in the mariadb and mysql2 drivers) belongs on the direct endpoint, which you get by turning the pooler port toggle off in the Connect dialog. The pooled endpoint presents a certificate generated by the pooler rather than the publicly trusted one for your database hostname, so a verify mode fails there.
- A hibernated MariaDB database wakes on connect: the port listener holds your connection open while the engine starts. The cold start is around 22 seconds, so give your client a 30 second connect timeout (the mariadb Node connector defaults to 1 second) or expect the first attempt to time out and retry. You can also start it from the dashboard before you connect, or pin it always-on so it never hibernates. Pinning draws from your plan pool rather than costing a separate add-on. See /docs/plans/always-on.