Skip to content

MySQL and MariaDB

KryoDesk talks to MySQL and MariaDB over TCP with the mysql_async client (TLS through macOS, see TLS certificate and password). localhost stays TCP; the Unix socket is not used. The server is recognised as MariaDB when VERSION() contains MariaDB.

Feature MySQL MariaDB
Browsing, search, query editor (needs SET SESSION TRANSACTION READ ONLY) 5.6.5+ 10.0+
Server-side statement limit max_execution_time (milliseconds) max_statement_time (seconds)
Users and privileges 5.7, 8.x, 9.x 10.x, 11.x
Roles 8.0+ 10.0.5+
ALTER USER with IDENTIFIED / REQUIRE / WITH 5.7.6+ 10.2+
ACCOUNT LOCK / UNLOCK 5.7.6+ 10.4.2+
PASSWORD EXPIRE DEFAULT / NEVER / INTERVAL n DAY 5.7.6+ 10.4.3+
CHECK constraints in the structure editor 8.0.16+ (with NOT ENFORCED) 10.2.1+ (no NOT ENFORCED)
Hidden index INVISIBLE (8.0) IGNORED (10.6)
JSON columns native type LONGTEXT with CHECK (json_valid(…)), shown as JSON

After the TCP connection, TLS and authentication (each step in the console):

  1. ProxySQL detection when In front of the server is Detect at login: select @@version_comment limit 1; the answer (ProxySQL) means ProxySQL.
  2. SET NAMES utf8mb4.
  3. SELECT VERSION(), @@version_comment, CURRENT_USER(), CONNECTION_ID(), @@hostname, @@character_set_server, @@collation_connection, @@sql_mode, @@character_set_client, @@character_set_connection. Client and connection character sets other than utf8mb4 stop the login (init_connect on the server can force another one).
  4. With TLS: SHOW SESSION STATUS WHERE Variable_name IN ('Ssl_version', 'Ssl_cipher').
  5. Directly on the server: ROLLBACK, SET SESSION TRANSACTION READ ONLY (required), SET SESSION max_execution_time = 60000 (MySQL) or SET SESSION max_statement_time = 60 (MariaDB). A server without the limit variable is used without it; the client still gives up after 90 s.
  6. Behind ProxySQL: SET autocommit = 1, then each of SET SESSION TRANSACTION READ ONLY and the time limit, each followed by PROXYSQL INTERNAL SESSION (see below).

Connect timeout 20 s per address; every address the host name resolves to is tried. While idle, a keepalive runs every 60 s. Up to 3 typed passwords per login.

  • Authentication plugins offered in the account form: MySQL 5.7 mysql_native_password, sha256_password, auth_socket; MySQL 8.x adds caching_sha2_password; MySQL 9.x caching_sha2_password, auth_socket; MariaDB mysql_native_password, ed25519, unix_socket (11.6+ also parsec).
  • Password clause: MySQL IDENTIFIED WITH <plugin> BY '…'; MariaDB 10.4+ IDENTIFIED VIA <plugin> USING PASSWORD('…'); MariaDB before 10.4 only IDENTIFIED BY '…'. On MariaDB IDENTIFIED replaces every authentication method of the account (the review warns).
  • SET DEFAULT ROLE: MySQL takes a list (… TO), MariaDB one role (… FOR). MySQL has no REVOKE ADMIN OPTION FOR: the role is revoked and granted again, which also drops it from the default roles (the review warns).
  • Default expressions in the structure editor: CURRENT_TIMESTAMP, CURRENT_DATE, CURRENT_TIME, UTC_TIMESTAMP, UUID(), JSON_ARRAY(), JSON_OBJECT(); MySQL also UUID_TO_BIN(UUID()) and UUID_TO_BIN(UUID(), 1).
  • DDL and long tools on MariaDB send SET SESSION max_statement_time = 0 first, since the limit also covers DDL there; the session check sets it back to 60 s.
  • information_schema.TABLES.TABLE_ROWS is an estimate for InnoDB (shown with ≈); on MySQL 8 it and AUTO_INCREMENT may come from the statistics cache (information_schema_stats_expiry).

In front of the server in the session: Detect at login (default), ProxySQL: only SETs it tracks, no transactions, The MySQL / MariaDB server itself.

Behind ProxySQL every session SET is followed by PROXYSQL INTERNAL SESSION. A SET that locks the session to one hostgroup (locked_on_hostgroup) is undone with COM_RESET_CONNECTION (or a new connection) and left out, so SELECTs still follow the query rules. Without PROXYSQL INTERNAL SESSION no session SET is sent at all. Errors 9005 / 9006 (hostgroup lock against a query rule) reset the connection and retry once.

Feature Behind ProxySQL
Browsing, search, Find text Work; no transactions and no SQL hints are sent.
Query editor Only when ProxySQL kept SET SESSION TRANSACTION READ ONLY at login; after each statement the session is always reset and set up again.
Write mode (grid, Run as change…, tree tools) Off.
Structure changes Only when the read-only flag was kept; lock_wait_timeout is not set.
Users and privileges Statements go where the query rules route them; ProxySQL’s own mysql_users is not changed.
Export / migration source No consistent snapshot (each statement may reach another backend); the plan says so.
Migration target Refused.

The console command proxysql prints the session state. Messages and error codes: Troubleshooting databases.

Scroll or pinch to zoom · drag to move · double-click to zoom · Esc or click outside to close