MariaDB Connection String Generator

Generate connection strings for MariaDB in any format. JDBC, .NET, Python, Node.js, Go, PHP, and more.

Client-side only — nothing leaves your browser

mariadb://root:@localhost:3306/mydb?charset=utf8mb4

What is a MariaDB Connection String?

A MariaDB connection string contains all the information needed to connect to a MariaDB database: host address, port, database name, credentials, SSL settings, and character set. MariaDB is a community-developed fork of MySQL with full wire-protocol compatibility, but uses its own drivers and URI scheme for best results.

SSL Mode Options

  • disabled — No SSL (not recommended for production)
  • required — Use SSL, don't verify certificate
  • verify_ca — Verify the server certificate is signed by a trusted CA
  • verify_identity — Verify certificate and hostname match

Quick Reference

FormatExample Pattern
MariaDB URImariadb://user:pass@host:3306/db?charset=utf8mb4
JDBC (MariaDB Connector/J)jdbc:mariadb://host:3306/db?user=user&password=pass&sslMode=required
.NET (MySqlConnector)Server=host;Port=3306;Database=db;User Id=user;Password=pass;SslMode=Required
Node.js (mariadb)mariadb://user:pass@host:3306/db
Python (mariadb)mariadb://user:pass@host:3306/db
Go (go-sql-driver)user:pass@tcp(host:3306)/db?tls=true&charset=utf8mb4
PHP (PDO)mysql:host=host;port=3306;dbname=db;charset=utf8mb4
Ruby (mysql2)mysql2://user:pass@host:3306/db

Frequently Asked Questions

What is a MariaDB connection string?
A MariaDB connection string is a formatted text value that contains all the parameters needed to establish a connection to a MariaDB database: host address, port, database name, credentials, SSL settings, and optional parameters like charset and timeout. The exact format varies by programming language and driver. For example, a URI-style connection string looks like mariadb://user:pass@localhost:3306/mydb.
What is the difference between a MariaDB and MySQL connection string?
MariaDB is a fork of MySQL and remains wire-protocol compatible, so most MySQL connection strings work with MariaDB. The key differences are the URI scheme (mariadb:// vs mysql://) and the JDBC driver class (org.mariadb.jdbc.Driver vs com.mysql.cj.jdbc.Driver). Some drivers like PHP PDO and Ruby mysql2 use the same mysql prefix for both databases. For best compatibility and access to MariaDB-specific features, use a dedicated MariaDB driver when available.
How do I find my MariaDB connection string?
If you're running MariaDB locally, your connection string typically uses host 'localhost', port 3306, and the credentials you set during installation (default user is 'root'). For cloud-hosted MariaDB (e.g., AWS RDS, SkySQL, DigitalOcean), check your provider's dashboard for the hostname, port, and credentials. You can also run 'SELECT @@hostname, @@port' in the MariaDB shell to confirm your server details.
How do I configure SSL in a MariaDB connection string?
MariaDB supports several SSL modes: 'disabled' for no encryption, 'required' to enforce SSL without certificate verification, 'verify_ca' to validate the server certificate against a trusted CA, and 'verify_identity' to also check that the server hostname matches the certificate. For production, use 'required' at minimum. The exact parameter name varies by driver — for example, JDBC uses 'sslMode', Go uses 'tls', and .NET uses 'SslMode'.
Why am I getting 'connection refused' when using my MariaDB connection string?
The most common causes are: (1) MariaDB is not running — check with 'systemctl status mariadb' or 'mysqladmin ping'; (2) wrong host or port — verify the server is listening on the expected address and port 3306; (3) firewall blocking the connection — ensure port 3306 is open; (4) the 'bind-address' in my.cnf is set to 127.0.0.1, preventing remote connections; (5) the user account lacks permission to connect from your IP — check with "SELECT host, user FROM mysql.user".
MariaDB

Need a MariaDB GUI Client?

1bench is a modern database client for MariaDB and 20+ other databases. Query, browse, and manage your data visually.

Learn More