MySQL.
Connect Orchid to MySQL 8+, MariaDB 10.5+, or PlanetScale. One connector covers self-hosted MySQL, RDS MySQL, Aurora-MySQL, and the MySQL wire-compatible providers.
Requirements
- MySQL 8.0+ or MariaDB 10.5+ (older versions work but aren't tested).
- A user with
SELECTon the schemas you care about. - The user must be allowed to connect from your IP (
CREATE USER ...@'%'or a specific host pattern).
Connect
- Open Integrations → + Add connection → MySQL.
- Fill in host, port (default
3306), database, user, password. - Click Test connection. Green check = ready.
Test from the command line first
Verifying credentials in your shell isolates Orchid from networking issues.
$ mysql -h db.example.com -P 3306 -u orchid_user -p --ssl-mode=REQUIRED analytics
Enter password:
Welcome to the MySQL monitor.
mysql> SELECT VERSION();
Optional settings
SSL / SSH
Toggle Require SSL if your provider enforces it (most managed providers do). SSH tunnel is supported with private key auth for bastion-host setups — the form is identical to the PostgreSQL SSH tunnel walkthrough.
MariaDB
MariaDB speaks the MySQL wire protocol. Use the same connector. A few small differences worth knowing:
- MariaDB's
SHOW DATABASESworks identically. - Some functions diverge (
SYSDATE()behavior,JSON_EXTRACTvsJSON_QUERY). If a query works on MySQL but fails on MariaDB, check the function reference for the engine you're actually targeting. - MariaDB
10.5+usesmysql_native_passwordby default, which avoids the auth gotcha below.
PlanetScale
PlanetScale exposes a MySQL-compatible endpoint with mandatory TLS. The setup:
- In the PlanetScale dashboard, open your branch → Connect.
- Pick General → create a new password.
- Copy the host, username, and password into Orchid.
- Toggle Require SSL on. PlanetScale rejects unencrypted connections.
- Database name is your PlanetScale database name; port is
3306.
PlanetScale does not support foreign keys at the storage layer — schema lookups still work, but if your queries assume FK joins are enforced, they aren't. Branch-level connections are perfect for sandboxing migrations against a dev branch.
Common gotchas
- "Host '1.2.3.4' is not allowed to connect" — your IP is missing from the user's allowed hosts. Recreate the user with the right host, or use SSH tunnel.
- "Authentication plugin 'caching_sha2_password' cannot be loaded" — old client/driver mismatch. Orchid ships a recent driver, but if you hit this on MySQL 8, set the user to
mysql_native_password:ALTER USER 'orchid'@'%' IDENTIFIED WITH mysql_native_password BY '...'; - Slow schema load — large
information_schemareads can be slow on shared hosts. The schema panel updates incrementally; first load takes longer. - SQL mode differences — Orchid runs queries verbatim. If your prod has
ANSI_QUOTESset, your SQL using"as a string delimiter will break unless you set the same mode in the connection. - Encoding garbled output — by far the most common gotcha. If non-ASCII characters render as
?or?-prefixed sequences, your client and server collations don't match. Force the connection charset by runningSET NAMES 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';at the top of the cell. For a permanent fix, set the column collation toutf8mb4_unicode_ciat the table level.utf8in MySQL is a 3-byte subset and breaks for emoji and many CJK characters; useutf8mb4. - "Lost connection to MySQL server during query" — usually the server's
wait_timeoutkilled an idle session, or your query exceedsmax_allowed_packet. Reconnect or chunk the result.
New MySQL connections start read-only. Flip Allow writes to enable mutations. A lock icon shows on cells using a write-enabled connection.
Example queries
-- List databases
SHOW DATABASES;
-- Top customers by revenue in the last 30 days
SELECT customer_id, SUM(total) AS revenue
FROM orders
WHERE created_at > NOW() - INTERVAL 30 DAY
GROUP BY customer_id
ORDER BY revenue DESC
LIMIT 25;
-- Check the active session encoding
SHOW VARIABLES LIKE 'character_set%';
Where to go next
For more on writing SQL cells, see SQL cells.