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 SELECT on the schemas you care about.
  • The user must be allowed to connect from your IP (CREATE USER ...@'%' or a specific host pattern).

Connect

  1. Open Integrations+ Add connectionMySQL.
  2. Fill in host, port (default 3306), database, user, password.
  3. Click Test connection. Green check = ready.
The MySQL connection form with host, port, database, user, password and TLS toggle./docs-images/connectors/mysql-form.png
The MySQL connection form. Same fields work for MariaDB, RDS, and PlanetScale.

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 DATABASES works identically.
  • Some functions diverge (SYSDATE() behavior, JSON_EXTRACT vs JSON_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+ uses mysql_native_password by default, which avoids the auth gotcha below.

PlanetScale

PlanetScale exposes a MySQL-compatible endpoint with mandatory TLS. The setup:

  1. In the PlanetScale dashboard, open your branch → Connect.
  2. Pick General → create a new password.
  3. Copy the host, username, and password into Orchid.
  4. Toggle Require SSL on. PlanetScale rejects unencrypted connections.
  5. 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_schema reads 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_QUOTES set, 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 running SET NAMES 'utf8mb4' COLLATE 'utf8mb4_unicode_ci'; at the top of the cell. For a permanent fix, set the column collation to utf8mb4_unicode_ci at the table level. utf8 in MySQL is a 3-byte subset and breaks for emoji and many CJK characters; use utf8mb4.
  • "Lost connection to MySQL server during query" — usually the server's wait_timeout killed an idle session, or your query exceeds max_allowed_packet. Reconnect or chunk the result.
Read vs write

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.