Connect MySQL and MariaDB
Prepare a read-only database account, configure the MySQL connection and verify a query as the intended user.
To analyze MySQL data in Querio, give it a dedicated read-only account, connect with a mysql:// URI, and check a query against a table you know. For MariaDB, use the same MySQL option and verify your server with the checks below; there is no separate MariaDB option.
Before you start
- Have permission to manage datasources in Querio and a database administrator who can create the account and grants.
- Choose the database and tables Querio should read. The examples use database
analyticsand tableorders; replace them with your own. - Get the database hostname, port (usually
3306), and TLS requirements from the administrator. - For a restricted network, confirm the source address shown by Copy IP Address in Querio's form. Have the network administrator permit that source to reach the database host and port. For a bastion, see SSH tunnel.
The server must listen on an interface Querio can reach. Its firewall must allow the connection too. A connection from your laptop does not prove Querio can reach it. See MySQL's bind-address setting or MariaDB's remote-access guide.
1. Create a dedicated user
Have the database administrator run this through an approved SQL administration tool. Replace QUERIO_SOURCE_HOST with the client host or IP as seen by MySQL, and set the password securely.
CREATE USER 'querio_reader'@'QUERIO_SOURCE_HOST'
IDENTIFIED BY 'REPLACE_WITH_SECRET'
REQUIRE SSL;This account host restriction is separate from the firewall rule: it identifies the connecting client, not the database server. For a direct connection it must match Querio's source; through SSH it must match the bastion-side source. A localhost account will not work for a remote client. See MySQL's account names and CREATE USER.
For MariaDB, check its CREATE USER syntax and use a password account that accepts network connections. Confirm your authentication plugin works with Querio's deployed client; a local-socket-only account will not work here.
2. Grant read-only access
Grant SELECT on each table Querio should read, then inspect the resulting grants:
GRANT SELECT ON `analytics`.`orders`
TO 'querio_reader'@'QUERIO_SOURCE_HOST';
SHOW GRANTS FOR 'querio_reader'@'QUERIO_SOURCE_HOST';If Querio should read the whole database, the administrator can grant SELECT ON analytics.* instead. Do not add write or administrative privileges for a read-only task. See MySQL GRANT or MariaDB GRANT.
These account-management statements do not need a separate FLUSH PRIVILEGES; see when privilege changes take effect. Check the grants through a new connection as this account. Metadata visibility also follows database privileges; a grant on one table does not expose every table in INFORMATION_SCHEMA.
3. Enter the connection in Querio
Open Settings > Datasources > Add datasource, choose Internal, and enter a unique Slug such as mysql-analytics. Choose MySQL as Database type, including when your server is MariaDB. Enter the complete Connection string:
mysql://querio_reader:ENCODED_PASSWORD@mysql.example.com:3306/analytics?charset=utf8mb4&ssl_mode=VERIFY_IDENTITYReplace the hostname and password. /analytics selects the database; the MySQL form has no separate schema field. The URI starts with mysql://. mysql2 is Querio's connector kind, not the URI scheme.
Percent-encode reserved characters in URI credentials. For example, p@ss:word becomes p%40ss%3Aword. The current connector does not preserve spaces in usernames or passwords; ask Querio about an affected credential before proceeding. Enter the URI in the form, never in an analysis prompt or support screenshot.
TLS options
The example requests ssl_mode=VERIFY_IDENTITY, which requires encryption, CA verification and a hostname matching the certificate when the required trust configuration is available. Have Querio confirm the gateway's CA setup. The account's REQUIRE SSL requires encryption but does not verify the server's identity. See MySQL encrypted connections.
The driver accepts ssl_mode, ssl_ca, ssl_cert and ssl_key URI options. Certificate and key paths refer to files on Querio's gateway, not your laptop. The form has no certificate upload control. Arrange private CA or client-certificate requirements with Querio before connecting. See the SQLAlchemy mysqlclient options and driver options.
TLS defaults depend on the server and deployed client. A successful connection test does not establish certificate verification. For MariaDB, see its TLS settings and checks.
SSH tunnel
If the database is reachable only through a bastion, follow Connect through an SSH tunnel. Choose SSH Tunnel, set Dst addr and Dst port to the database destination reachable from the bastion, and use Db > Client mysql2 or mysql. The database account's host must match the bastion-side source. The tunnel does not establish TLS between the bastion and database; confirm that leg's encryption requirements before connecting. Querio's managed SSH key setup and the form's key limitation are covered in the SSH guide.
4. Test, save and verify a table query
- Select Test connection. Resolve any error before saving. Then select Create; Querio tests the connection again before saving it.
- Follow Connect a datasource to review access and add tables to Context. The first credential is initially assigned to Everyone. Each person who queries needs datasource permission and exactly one distinct authorized credential.
- As an intended user, open an Explore with this datasource selected. Run the identity check and a small read from an approved table below. Inspect the SQL and results.
Catalog refresh is separate from connectivity. If it fails or the expected tables are absent, ask Querio to review the error before treating setup as complete. Do not grant administrative access to try to repair a metadata failure.
SELECT CURRENT_USER() AS database_account, DATABASE() AS database_name;Expect the configured database account and analytics. Then replace these table, column and ID examples with a record you can check independently:
SELECT order_id, status
FROM analytics.orders
WHERE order_id = 1001
LIMIT 1;Compare the row with a trusted result under the same account and data snapshot. An empty result may be valid; check why before proceeding. A successful connection test or identity query alone does not establish access to orders.
To check a query's TLS session, run SHOW SESSION STATUS LIKE 'Ssl_version';. A nonempty value indicates TLS on that connection, not certificate identity verification. Querio can use a new database connection for the next query, so do not rely on a prior USE statement or session setting.
Continue with Add and improve context and Analyze your data.
MariaDB compatibility
Use MySQL and a mysql:// URI for a MariaDB server. The underlying SQLAlchemy dialect detects MariaDB after connecting; Querio does not offer a separate MariaDB database type. See SQLAlchemy's MariaDB support notes.
This does not guarantee that every MariaDB release, authentication plugin, type or SQL extension works with Querio's deployed client. Test authentication, TLS, table discovery and a real table query. Keep the database explicit in the URI, and check the types and values your analysis needs.
If a check fails
| Symptom | Next check |
|---|---|
| Connection refused or timeout | Confirm DNS, port, listener/interface and firewall route from Querio. Check the source address shown in the form. |
| Access denied for the database account | Review the password, URI encoding, account host match and authentication plugin with the administrator. Credentials containing spaces need Querio review. |
| TLS or certificate error | Confirm server TLS configuration, matching hostname, trusted CA and any runtime certificate/key paths. |
| Unknown database, missing table or metadata | Check the URI database, table-name case and the account's grants on the intended objects. |
| Connection test succeeds but table query is denied | Check upstream SELECT grants and Querio's datasource permission and credential assignment as that user. |
| Querio reports multiple authorized credentials | Reconcile effective assignments to one distinct credential; Default does not choose one. |
Use Datasources and credentials for the shared contract and Troubleshoot and get help if the failure remains unexplained. Redact the URI and secret values from any support evidence.
Last updated on December 1, 2026