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 |
Login sequence
Section titled “Login sequence”After the TCP connection, TLS and authentication (each step in the console):
- ProxySQL detection when In front of the server is Detect at login:
select @@version_comment limit 1; the answer(ProxySQL)means ProxySQL. SET NAMES utf8mb4.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 thanutf8mb4stop the login (init_connecton the server can force another one).- With TLS:
SHOW SESSION STATUS WHERE Variable_name IN ('Ssl_version', 'Ssl_cipher'). - Directly on the server:
ROLLBACK,SET SESSION TRANSACTION READ ONLY(required),SET SESSION max_execution_time = 60000(MySQL) orSET SESSION max_statement_time = 60(MariaDB). A server without the limit variable is used without it; the client still gives up after 90 s. - Behind ProxySQL:
SET autocommit = 1, then each ofSET SESSION TRANSACTION READ ONLYand the time limit, each followed byPROXYSQL 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.
Version differences in generated SQL
Section titled “Version differences in generated SQL”- Authentication plugins offered in the account form: MySQL 5.7
mysql_native_password,sha256_password,auth_socket; MySQL 8.x addscaching_sha2_password; MySQL 9.xcaching_sha2_password,auth_socket; MariaDBmysql_native_password,ed25519,unix_socket(11.6+ alsoparsec). - Password clause: MySQL
IDENTIFIED WITH <plugin> BY '…'; MariaDB 10.4+IDENTIFIED VIA <plugin> USING PASSWORD('…'); MariaDB before 10.4 onlyIDENTIFIED BY '…'. On MariaDBIDENTIFIEDreplaces every authentication method of the account (the review warns). SET DEFAULT ROLE: MySQL takes a list (… TO), MariaDB one role (… FOR). MySQL has noREVOKE 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 alsoUUID_TO_BIN(UUID())andUUID_TO_BIN(UUID(), 1). - DDL and long tools on MariaDB send
SET SESSION max_statement_time = 0first, since the limit also covers DDL there; the session check sets it back to 60 s. information_schema.TABLES.TABLE_ROWSis an estimate for InnoDB (shown with≈); on MySQL 8 it andAUTO_INCREMENTmay come from the statistics cache (information_schema_stats_expiry).
ProxySQL
Section titled “ProxySQL”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.