Skip to content

MySQL, MariaDB and ProxySQL

The tab of a MySQL session is a console that logs every step and every statement (sql> …) with its time. Fields and the statements sent after login: MySQL / MariaDB sessions. Messages of the Databases window, query editor, write mode, structure changes, users and migrations: Troubleshooting databases.

A server error is printed as

server error <code> (SQLSTATE <state>): <server's message> (<KryoDesk's note>)
Code or message Note printed What to check
1045 wrong login or password, or no account for this client address On the server: SELECT user, host FROM mysql.user WHERE user = '<user>'; The host part must match this computer’s address as the server sees it (NAT, VPN). A saved password that fails: Password saved in Keychain (password:mysql://…) was rejected; it stays there until you save a new one.
1130 no account matches this client address: the server needs a user for ‘user’@‘<this computer’s address as the server sees it>’ As above; also printed before any login by the Connection test (MySQL/MariaDB, refuses this client).
1129 the server blocked this client address after too many connection errors; an admin on the server runs FLUSH HOSTS / mysqladmin flush-hosts max_connect_errors on the server.
1040 max_connections reached on the server SHOW STATUS LIKE 'Threads_connected';
1698 the account logs in with unix_socket/auth_socket: only a local system user of the same name can log in, e.g. over SSH on the server Use another account, or mysql in an SSH tab on the server.
1049 no such database Database in the session.
3159 the server requires TLS: set Encryption to Preferred or Required require_secure_transport = ON on the server.
<ip:port>: connection error: Connection refused (os error 61) (ConnectionRefused) after <n> ms — bind-address and port in the server’s configuration, firewall. Each address of the host name is tried; the last failure ends with cannot connect to <host>:<port>: ….
the server does not offer TLS (no CLIENT_SSL capability; have_ssl = DISABLED?) and the session requires it — Encryption is Required; enable TLS on the server (SHOW VARIABLES LIKE 'have_ssl';) or choose Preferred.
TLS error: … then The certificate of <host> is not trusted by macOS (self-signed, as MySQL generates by default, expired, another host name or an unknown CA). … (Windows: not trusted by Windows) — openssl s_client -connect <host>:3306 -starttls mysql -servername <host> </dev/null shows the certificate. y to Connect anyway without verifying the certificate? [y/N] connects encrypted without authenticating the server.
Message Cause and fix
SET SESSION TRANSACTION READ ONLY: …; the browser opens only read-only sessions (MySQL 5.6.5+, MariaDB 10.0+) The server is older, or something in front of it refuses the statement. The tab does not open without a read-only session.
the session charset is client … / connection … after SET NAMES utf8mb4; the browser needs utf8mb4 to quote names and values safely The server (for example through init_connect) forces another character set.
… (continuing without a server-side time limit; the client stops waiting after 90s) max_execution_time / max_statement_time is not supported (older servers).
-> no answer from the server within 90s; the connection is closed (the statement may still run on the server; to check: SHOW PROCESSLIST (connection <id>), to stop it: KILL QUERY <id>) A statement took longer than 90 s. Find it with SHOW PROCESSLIST on the server and stop it with KILL QUERY <id>. Behind ProxySQL: … may still run on the backend; to stop it: SELECT * FROM stats_mysql_processlist in the ProxySQL admin interface, then KILL QUERY <id> on the backend.
3024 or 1969: (stopped by the server's statement time limit) The 60 s server-side limit stopped the statement.

Detection: select @@version_comment limit 1 returns (ProxySQL) from ProxySQL itself. Then each session SET is followed by PROXYSQL INTERNAL SESSION to see whether ProxySQL locked the session to one hostgroup.

Message Meaning and what to check
ProxySQL locked the session to hostgroup <n> after <SET> (this version does not track it): undoing it and continuing without it, so SELECTs can still go to the reader hostgroup. This ProxySQL version does not track that variable. KryoDesk resets the connection (COM_RESET_CONNECTION, or a new connection) and goes on without that SET.
Behind ProxySQL: read-only session flag OFF (see above), … The read-only SET was left out for the reason above. The browser still sends only SELECT and SHOW.
PROXYSQL INTERNAL SESSION is not available, so a hostgroup lock cannot be checked: no session SETs are sent (no read-only flag, no server time limit). ProxySQL refuses the statement (older version, or a query rule).
The session is already locked to hostgroup <n> (init_connect?); resetting. Something locked the session before KryoDesk’s first statement, for example init_connect on the backend.
9006 with note ProxySQL: the session is locked to one hostgroup and the query rules route this statement to another; see transaction_persistent and locked_on_hostgroup in PROXYSQL INTERNAL SESSION KryoDesk resets the connection and retries once. If it repeats: the proxysql console command prints the session state; check the user’s transaction_persistent and query rules in the admin interface (SELECT * FROM mysql_query_rules;).
9001 with note ProxySQL: no backend of the target hostgroup answered in time The backends of that hostgroup are down or shunned: SELECT * FROM runtime_mysql_servers; in the admin interface.
Not sent: the announced server version <x.y.z> (ProxySQL mysql-server_version) predates COM_RESET_CONNECTION. KryoDesk opens a new connection instead of resetting.

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