mysqldude

SQL checker and formatter

Paste your SQL to see which MySQL and MariaDB versions will reject it and why, before you upgrade or migrate. Every rule was run on all nine servers (MySQL 5.6–9.x, MariaDB 10.6–11.8), and the verdicts below are what those servers actually did.

🔒 The check runs in your browser. Your SQL is not sent anywhere.

What it checks, and what it can't

  • 90 syntax and behaviour rules: features added in newer versions (window functions, CTEs, LATERAL, JSON operators), syntax that was removed (GROUP BY … DESC, GRANT … IDENTIFIED BY, PASSWORD()), MariaDB-only and MySQL-only syntax, renamed replication statements and variables, deprecations that now warn, and sql_mode defaults such as ONLY_FULL_GROUP_BY and NO_ZERO_DATE.
  • 61 reserved words whose status changes between versions, when they are used unquoted as a column, table or alias name. See the reserved word table.
  • Each rule has a probe statement that was run on every server with its default settings. The verdicts and error messages shown are the servers' own (last run 2026-11-28). The full list is at the bottom of this page.
This is an informed lint, not the server's own parser. It recognises the patterns above. It can't see your schema, server settings or data, so it can't catch every problem, and the GROUP BY checks may flag columns that are fine because they depend on a grouped primary key. The only sure test is to run your SQL on the target version. We can do that for you.

All rules and their test results

✓ runs · ! warning or different behaviour · ✗ fails. Hover a cell to see what the server said.

RuleMySQLMariaDB
5.65.78.08.4910.610.1111.411.8
Query syntax
Window functions (OVER …)

Window functions (ROW_NUMBER, RANK, LAG, SUM … OVER) are not understood by older servers.

Fix: On older servers rewrite with a self-join or a correlated subquery, or upgrade.

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT a, ROW_NUMBER() OVER (ORDER BY b) AS rn FROM t;
✗✗✓✓✓✓✓✓✓
Common table expressions (WITH … AS)

WITH clauses (including WITH RECURSIVE) are not understood by older servers.

Fix: Move the CTE into a derived table (FROM (SELECT …) AS c), or use a temporary table for recursive queries.

Tested with:

WITH c AS (SELECT 1 AS x) SELECT x FROM c;
✗✗✓✓✓✓✓✓✓
LATERAL derived tables

A LATERAL derived table can refer to columns of tables earlier in the FROM clause.

Fix: Rewrite as a correlated subquery in the select list, or a join on a grouped derived table.

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT t.a, d.x FROM t, LATERAL (SELECT t.a + 1 AS x) AS d;
✗✗✓✓✓✗✗✗✗
JSON_TABLE()

JSON_TABLE turns a JSON document into rows.

Fix: Extract values with JSON_EXTRACT in application code, or upgrade.

Tested with:

SELECT j.x FROM JSON_TABLE('[1,2]', '$[*]' COLUMNS (x INT PATH '$')) AS j;
✗✗✓✓✓✓✓✓✓
INTERSECT and EXCEPT

INTERSECT and EXCEPT set operators are not understood by older servers.

Fix: Use WHERE EXISTS (…) for INTERSECT and WHERE NOT EXISTS (…) or a LEFT JOIN … IS NULL for EXCEPT.

Tested with:

SELECT 1 AS x INTERSECT SELECT 1;
✗✗✓✓✓✓✓✓✓
VALUES ROW(…) table value constructor

VALUES ROW(…) builds a table from literal rows.

Fix: Use SELECT 1, 2 UNION ALL SELECT 3, 4 instead.

Tested with:

VALUES ROW(1, 2), ROW(3, 4);
✗✗✓✓✓✗✗✗✗
INSERT … AS alias ON DUPLICATE KEY UPDATE

A row alias lets ON DUPLICATE KEY UPDATE refer to the new row as alias.col.

Fix: Use VALUES(col) where the row alias is not supported (it is deprecated where the alias is).

Tested with:

CREATE TABLE t (id INT PRIMARY KEY, n INT);
INSERT INTO t VALUES (1, 1) AS new ON DUPLICATE KEY UPDATE n = new.n;
✗✗✓✓✓✗✗✗✗
VALUES(col) in ON DUPLICATE KEY UPDATE

Referring to the new row with VALUES(col) is deprecated in favour of a row alias.

Fix: Write INSERT … VALUES (…) AS new ON DUPLICATE KEY UPDATE n = new.n on servers that support it.

Tested with:

CREATE TABLE t (id INT PRIMARY KEY, n INT);
INSERT INTO t VALUES (1, 1) ON DUPLICATE KEY UPDATE n = VALUES(n);
✓✓!!!✓✓✓✓
SQL_CALC_FOUND_ROWS and FOUND_ROWS()

SQL_CALC_FOUND_ROWS and FOUND_ROWS() are deprecated.

Fix: Run a separate SELECT COUNT(*) with the same WHERE clause.

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT SQL_CALC_FOUND_ROWS a FROM t LIMIT 1;
✓✓!!!✓✓✓✓
GROUP BY … ASC/DESC

Older servers sorted by the GROUP BY columns and accepted ASC/DESC there; that syntax was removed.

Fix: Drop ASC/DESC from GROUP BY and add an explicit ORDER BY.

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT a FROM t GROUP BY a DESC;
✓!✗✗✗✓✓✓✓
Columns in SELECT that are not in GROUP BY (ONLY_FULL_GROUP_BY)

With ONLY_FULL_GROUP_BY in sql_mode, every selected column must be grouped, aggregated, or functionally dependent on the GROUP BY columns (for example grouped by the primary key). Otherwise the query fails with error 1055.

Fix: Add the column to GROUP BY, wrap it in an aggregate or ANY_VALUE(), or group by the table's primary key.

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT a, b FROM t GROUP BY a;
✓✗✗✗✗✓✓✓✓
Aggregate and plain columns without GROUP BY

Mixing an aggregate such as COUNT(*) with plain columns and no GROUP BY is rejected under ONLY_FULL_GROUP_BY (error 1140).

Fix: Add GROUP BY for the plain columns, or wrap them in an aggregate or ANY_VALUE().

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT a, COUNT(*) FROM t;
✓✗✗✗✗✓✓✓✓
FULL OUTER JOIN

FULL OUTER JOIN comes from other databases.

Fix: Combine a LEFT JOIN and a RIGHT JOIN with UNION.

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT * FROM t AS x FULL OUTER JOIN t AS y ON x.a = y.a;
✗✗✗✗✗✗✗✗✗
PostgreSQL-style :: casts

:: casts are PostgreSQL syntax.

Fix: Use CAST(x AS SIGNED) or CONVERT().

Tested with:

SELECT 1::int;
✗✗✗✗✗✗✗✗✗
SELECT TOP n

TOP n is SQL Server syntax.

Fix: Put LIMIT n at the end of the query.

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT TOP 1 a FROM t;
✗✗✗✗✗✗✗✗✗
|| for string concatenation

By default || is logical OR, not concatenation, so 'a' || 'b' returns 0. It only concatenates with PIPES_AS_CONCAT in sql_mode.

Fix: Use CONCAT(a, b), or OR for a logical test.

Tested with:

SELECT 'a' || 'b';
!!!!!!!!!
ISNULL(a, b) with two arguments

ISNULL takes one argument here; the two-argument form is SQL Server syntax.

Fix: Use IFNULL(a, b) or COALESCE(a, b).

Tested with:

SELECT ISNULL(NULL, 1);
✗✗✗✗✗✗✗✗✗
INSERT … ON CONFLICT

ON CONFLICT is PostgreSQL syntax.

Fix: Use INSERT IGNORE, or INSERT … ON DUPLICATE KEY UPDATE.

Tested with:

CREATE TABLE t (a INT, b INT);
INSERT INTO t VALUES (1, 1) ON CONFLICT DO NOTHING;
✗✗✗✗✗✗✗✗✗
Single-table DELETE with a table alias

An alias on the table of a single-table DELETE is not understood by every server.

Fix: Drop the alias, or use the multi-table form DELETE x FROM t AS x WHERE ….

Tested with:

CREATE TABLE t (a INT, b INT);
DELETE FROM t AS x WHERE x.a = 1;
✗✗✓✓✓✗✗✗✓
SKIP LOCKED / NOWAIT

SKIP LOCKED and NOWAIT change how locking reads wait for other transactions.

Fix: Remove them on older servers (the query then waits for locks).

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT a FROM t FOR UPDATE SKIP LOCKED;
✗✗✓✓✓✓✓✓✓
SELECT … FOR SHARE

FOR SHARE is the newer spelling of LOCK IN SHARE MODE.

Fix: Use LOCK IN SHARE MODE.

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT a FROM t FOR SHARE;
✗✗✓✓✓✗✗✗✗
EXPLAIN ANALYZE

EXPLAIN ANALYZE runs the query and reports actual timings.

Fix: On MariaDB use ANALYZE SELECT …; on older MySQL use EXPLAIN.

Tested with:

EXPLAIN ANALYZE SELECT 1;
✗✗✓✓✓✗✗✗✗
EXPLAIN FORMAT=TREE

The tree output format is not available everywhere.

Fix: Use EXPLAIN or EXPLAIN FORMAT=JSON.

Tested with:

EXPLAIN FORMAT=TREE SELECT 1;
✗✗✓✓✓✗✗✗✗
Functions
REGEXP_REPLACE / REGEXP_SUBSTR / REGEXP_INSTR

These regular-expression functions are not available on older servers.

Fix: Use REPLACE/SUBSTRING/LOCATE, or do the work in application code.

Tested with:

SELECT REGEXP_REPLACE('abc', 'b', 'x');
✗✗✓✓✓✓✓✓✓
REGEXP_LIKE()

REGEXP_LIKE is not available everywhere.

Fix: Use expr REGEXP pattern.

Tested with:

SELECT REGEXP_LIKE('abc', 'b');
✗✗✓✓✓✗✗✗✗
ANY_VALUE()

ANY_VALUE() picks any value of a column in a group and silences ONLY_FULL_GROUP_BY.

Fix: Use MIN() or MAX() instead.

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT ANY_VALUE(a) FROM t;
✗✓✓✓✓✗✗✗✗
JSON -> and ->> operators

col->'$.path' and col->>'$.path' are shorthand for JSON_EXTRACT and JSON_UNQUOTE(JSON_EXTRACT(…)).

Fix: Write JSON_EXTRACT(col, '$.path') and JSON_UNQUOTE(JSON_EXTRACT(col, '$.path')), which work everywhere JSON is supported.

Tested with:

CREATE TABLE t (j TEXT);
INSERT INTO t VALUES ('{"a": 1}');
SELECT j->'$.a', j->>'$.a' FROM t;
✗✓✓✓✓✗✗✗✗
JSON column type

The JSON data type stores validated JSON documents. MariaDB accepts it as an alias for LONGTEXT with a JSON_VALID check.

Fix: Use LONGTEXT (or TEXT) where JSON is not supported.

Tested with:

CREATE TABLE t (j JSON);
✗✓✓✓✓✓✓✓✓
CAST(… AS JSON)

Casting to JSON is not supported everywhere.

Fix: Use JSON_EXTRACT(value, '$') or JSON_COMPACT() to get a JSON value.

Tested with:

SELECT CAST('[1]' AS JSON);
✗✓✓✓✓✗✗✗✗
JSON_ARRAYAGG / JSON_OBJECTAGG

These aggregate functions build a JSON array or object from a group.

Fix: Use CONCAT('[', GROUP_CONCAT(…), ']') on older servers.

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT JSON_ARRAYAGG(a) FROM t;
✗✓✓✓✓✓✓✓✓
JSON_VALUE()

JSON_VALUE extracts a scalar from a JSON document.

Fix: Use JSON_UNQUOTE(JSON_EXTRACT(doc, path)).

Tested with:

SELECT JSON_VALUE('{"a": 1}', '$.a');
✗✗✓✓✓✓✓✓✓
MEMBER OF()

value MEMBER OF(json_array) tests array membership.

Fix: Use JSON_CONTAINS(json_array, CAST(value AS CHAR)).

Tested with:

SELECT 1 MEMBER OF('[1, 2]');
✗✗✓✓✓✗✗✗✗
JSON_OVERLAPS()

JSON_OVERLAPS tests whether two documents share an element.

Fix: Combine JSON_CONTAINS checks.

Tested with:

SELECT JSON_OVERLAPS('[1, 2]', '[2, 3]');
✗✗✓✓✓✗✓✓✓
UUID_TO_BIN / BIN_TO_UUID

These functions convert UUIDs to and from BINARY(16).

Fix: Use UNHEX(REPLACE(uuid, '-', '')), or the UUID data type on MariaDB.

Tested with:

SELECT UUID_TO_BIN(UUID());
✗✗✓✓✓✗✗✗✗
PASSWORD() function

The PASSWORD() hashing function was removed from MySQL.

Fix: Set passwords with ALTER USER … IDENTIFIED BY 'plain text'.

Tested with:

SELECT PASSWORD('secret');
✓!✗✗✗✓✓✓✓
ENCRYPT()

ENCRYPT() (Unix crypt) was removed from MySQL.

Fix: Use SHA2() or hash in application code.

Tested with:

SELECT ENCRYPT('secret', 'ab');
✓!✗✗✗✓✓✓✓
DES_ENCRYPT / DES_DECRYPT

The DES functions were removed from MySQL.

Fix: Use AES_ENCRYPT / AES_DECRYPT.

Tested with:

SELECT DES_ENCRYPT('secret', 'key');
✓!✗✗✗✓!!!
ENCODE() / DECODE()

ENCODE() and DECODE() were removed from MySQL.

Fix: Use AES_ENCRYPT / AES_DECRYPT.

Tested with:

SELECT ENCODE('secret', 'key');
✓!✗✗✗✓✓✓✓
Spatial functions without the ST_ prefix

Spatial functions without the ST_ prefix were removed from MySQL.

Fix: Use the ST_ names: ST_GeomFromText, ST_AsText, ST_Length ….

Tested with:

SELECT AsText(GeomFromText('POINT(1 1)'));
✓!✗✗✗✓✓✓✓
Table definitions
ALTER TABLE … RENAME COLUMN

RENAME COLUMN renames a column without restating its definition.

Fix: Use CHANGE COLUMN old new <full column definition>.

Tested with:

CREATE TABLE t (a INT, b INT);
ALTER TABLE t RENAME COLUMN a TO c;
✗✗✓✓✓✓✓✓✓
CREATE OR REPLACE TABLE

CREATE OR REPLACE TABLE is MariaDB syntax.

Fix: Use DROP TABLE IF EXISTS t followed by CREATE TABLE t.

Tested with:

CREATE OR REPLACE TABLE t (a INT);
✗✗✗✗✗✓✓✓✓
CHECK constraints are enforced

Where CHECK constraints are not enforced they are parsed and silently ignored, so rows that break them are stored without an error.

Fix: Enforce the rule with a trigger or in application code on those versions.

Tested with:

CREATE TABLE t (a INT, CHECK (a > 0));
INSERT INTO t VALUES (-1);
!!✓✓✓✓✓✓✓
DEFAULT (expression)

Expression defaults in parentheses are not understood by older servers.

Fix: Use a literal default, or set the value in a trigger.

Tested with:

CREATE TABLE t (a INT DEFAULT (1 + 1));
✗✗✓✓✓✓✓✓✓
Literal DEFAULT on TEXT/BLOB columns

TEXT and BLOB columns can't have a literal default on every server.

Fix: Use VARCHAR, an expression default DEFAULT ('x'), or set the value in the INSERT.

Tested with:

CREATE TABLE t (a TEXT DEFAULT 'x');
✗✗✗✗✗✓✓✓✓
Functional index (INDEX ((expr)))

An index on an expression needs the expression in its own parentheses.

Fix: Add a generated column for the expression and index that.

Tested with:

CREATE TABLE t (a INT, INDEX ((a + 1)));
✗✗✓✓✓✗✗✗✗
Generated columns

Generated (computed) columns are not understood by older servers.

Fix: Compute the value in a trigger or a view.

Tested with:

CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a + 1) VIRTUAL);
✗✓✓✓✓✓✓✓✓
INVISIBLE columns or indexes

Invisible columns are left out of SELECT *. (MariaDB calls invisible indexes IGNORED.)

Fix: Remove INVISIBLE on servers that don't support it.

Tested with:

CREATE TABLE t (a INT, b INT INVISIBLE);
✗✗✓✓✓✓✓✓✓
Integer display width, e.g. INT(11)

The number in INT(11) is only a display width, not a size limit, and it is deprecated.

Fix: Write INT. TINYINT(1) is still accepted without a warning.

Tested with:

CREATE TABLE t (a INT(11));
✓✓!!!✓✓✓✓
ZEROFILL

ZEROFILL is deprecated.

Fix: Pad in the query with LPAD(a, 5, '0'), or in application code.

Tested with:

CREATE TABLE t (a INT ZEROFILL);
✓✓!!!✓✓✓✓
FLOAT(M,D) / DOUBLE(M,D)

FLOAT(M,D) and DOUBLE(M,D) are deprecated.

Fix: Use DECIMAL(M,D) for exact values, or plain FLOAT/DOUBLE.

Tested with:

CREATE TABLE t (a FLOAT(7,2));
✓✓!!!✓✓✓✓
YEAR(2)

The two-digit YEAR(2) type was removed.

Fix: Use YEAR (four digits).

Tested with:

CREATE TABLE t (y YEAR(2));
!✗✗✗✗!!!!
YEAR(4)

The display width in YEAR(4) is deprecated.

Fix: Write YEAR.

Tested with:

CREATE TABLE t (y YEAR(4));
✓✓!!!✓✓✓✓
TYPE=MyISAM instead of ENGINE=

TYPE= is the very old spelling of ENGINE=.

Fix: Write ENGINE=MyISAM (or ENGINE=InnoDB).

Tested with:

CREATE TABLE t (a INT) TYPE=MyISAM;
✗✗✗✗✗✗✗✗✗
ENGINE=Aria

Aria is a MariaDB storage engine.

Fix: Use ENGINE=InnoDB (or MyISAM).

Tested with:

CREATE TABLE t (a INT) ENGINE=Aria;
✗✗✗✗✗✓✓✓✓
System-versioned tables

System-versioned (temporal) tables are a MariaDB feature.

Fix: Keep history with triggers and a history table.

Tested with:

CREATE TABLE t (a INT) WITH SYSTEM VERSIONING;
✗✗✗✗✗✓✓✓✓
Sequences (CREATE SEQUENCE, NEXTVAL)

Sequences are a MariaDB feature.

Fix: Use an AUTO_INCREMENT column.

Tested with:

CREATE SEQUENCE s;
✗✗✗✗✗✓✓✓✓
UUID column type

UUID is a MariaDB data type.

Fix: Use BINARY(16) or CHAR(36).

Tested with:

CREATE TABLE t (u UUID);
✗✗✗✗✗✗✓✓✓
INET6 / INET4 column types

INET6 and INET4 are MariaDB data types.

Fix: Use VARBINARY(16) with INET6_ATON() / INET6_NTOA().

Tested with:

CREATE TABLE t (ip INET6);
✗✗✗✗✗✓✓✓✓
ADD COLUMN / INDEX IF NOT EXISTS

IF NOT EXISTS inside ALTER TABLE is MariaDB syntax.

Fix: Check information_schema.COLUMNS first, or run it in a procedure that ignores the duplicate error.

Tested with:

CREATE TABLE t (a INT, b INT);
ALTER TABLE t ADD COLUMN IF NOT EXISTS c INT;
✗✗✗✗✗✓✓✓✓
DROP COLUMN / INDEX IF EXISTS

IF EXISTS inside ALTER TABLE is MariaDB syntax.

Fix: Check information_schema first.

Tested with:

CREATE TABLE t (a INT, b INT);
ALTER TABLE t DROP COLUMN IF EXISTS zz;
✗✗✗✗✗✓✓✓✓
CREATE INDEX IF NOT EXISTS

CREATE INDEX IF NOT EXISTS is MariaDB syntax.

Fix: Check information_schema.STATISTICS first.

Tested with:

CREATE TABLE t (a INT, b INT);
CREATE INDEX IF NOT EXISTS i ON t (a);
✗✗✗✗✗✓✓✓✓
ALTER IGNORE TABLE

ALTER IGNORE TABLE drops rows that would break a new unique key.

Fix: Delete the duplicates first (or copy the distinct rows into a new table), then add the key.

Tested with:

CREATE TABLE t (a INT, b INT);
ALTER IGNORE TABLE t ADD UNIQUE (a);
!✗✗✗✗✓✓✓✓
Zero-date default ('0000-00-00')

With NO_ZERO_DATE and strict mode in sql_mode, a zero date is not a valid default (error 1067).

Fix: Use NULL, a real date, or DEFAULT CURRENT_TIMESTAMP.

Tested with:

CREATE TABLE t (d DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00');
✓✗✗✗✗✓✓✓✓
Zero-date values ('0000-00-00')

With NO_ZERO_DATE and strict mode in sql_mode, storing a zero date fails.

Fix: Store NULL instead of a zero date.

Tested with:

CREATE TABLE t (d DATE);
INSERT INTO t VALUES ('0000-00-00');
✓✗✗✗✗✓✓✓✓
Character sets and collations
utf8 / utf8mb3 character set

utf8 is an alias for utf8mb3, which stores at most 3 bytes per character (no emoji) and is deprecated.

Fix: Use utf8mb4.

Tested with:

CREATE TABLE t (a VARCHAR(10)) CHARACTER SET utf8;
✓✓!!!✓✓✓✓
utf8mb4_0900_* collations

The utf8mb4_0900_* collations are MySQL 8 collations; dumps taken from MySQL 8 carry them into other servers.

Fix: Use utf8mb4_unicode_ci (or utf8mb4_uca1400_ai_ci on MariaDB) when moving the schema.

Tested with:

CREATE TABLE t (a VARCHAR(10)) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
✗✗✓✓✓✗✗✓✓
Users and privileges
IDENTIFIED BY PASSWORD '*hash'

Setting an account from a pre-computed hash with IDENTIFIED BY PASSWORD was removed from MySQL.

Fix: Use IDENTIFIED WITH mysql_native_password AS '*hash' where that plugin exists, or set a plain password.

Tested with:

CREATE USER 'sr_p'@'%' IDENTIFIED BY PASSWORD '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29';
✓!✗✗✗✓✓✓✓
GRANT … IDENTIFIED BY

Creating an account or setting its password inside GRANT is gone from MySQL.

Fix: Run CREATE USER … IDENTIFIED BY … first, then GRANT without IDENTIFIED BY.

Tested with:

GRANT SELECT ON *.* TO 'sr_g'@'%' IDENTIFIED BY 'Pw#12345678';
✓!✗✗✗✓✓✓✓
mysql_native_password

The mysql_native_password plugin is disabled by default or removed in newer MySQL. (On MariaDB this rule tests the MariaDB spelling, IDENTIFIED VIA … USING PASSWORD(…).)

Fix: Use caching_sha2_password (MySQL) and a client library that supports it.

Tested with:

CREATE USER 'sr_n'@'%' IDENTIFIED WITH mysql_native_password BY 'Pw#12345678';
✗✓✓✗✗✓✓✓✓
CREATE USER IF NOT EXISTS

IF NOT EXISTS for users is not understood by older servers.

Fix: Check mysql.user first.

Tested with:

CREATE USER IF NOT EXISTS 'sr_c'@'%' IDENTIFIED BY 'Pw#12345678';
✗✓✓✓✓✓✓✓✓
DROP USER IF EXISTS

IF EXISTS for users is not understood by older servers.

Fix: Check mysql.user first.

Tested with:

DROP USER IF EXISTS 'sr_nobody'@'%';
✗✓✓✓✓✓✓✓✓
CREATE ROLE / DROP ROLE

Roles are not available on older servers.

Fix: Grant privileges to each account directly.

Tested with:

CREATE ROLE sr_role;
✗✗✓✓✓✓✓✓✓
NO_AUTO_CREATE_USER in sql_mode

The NO_AUTO_CREATE_USER mode was removed from MySQL; old dumps and config files still set it.

Fix: Remove NO_AUTO_CREATE_USER from the sql_mode list.

Tested with:

SET SESSION sql_mode = 'NO_AUTO_CREATE_USER';
✓✓✗✗✗✓✓✓✓
Server variables
SET PERSIST

SET PERSIST saves a setting across restarts.

Fix: Set it in my.cnf instead.

Tested with:

SET PERSIST max_connections = 151;
✗✗✓✓✓✗✗✗✗
Query cache variables

The query cache was removed from MySQL.

Fix: Remove query cache settings and statements.

Tested with:

SELECT @@query_cache_size;
✓!✗✗✗✓✓✓✓
SQL_CACHE / SQL_NO_CACHE / FLUSH QUERY CACHE

The query cache was removed from MySQL; its hints are deprecated or gone.

Fix: Remove the hint.

Tested with:

CREATE TABLE t (a INT, b INT);
SELECT SQL_NO_CACHE a FROM t;
✓!!!!✓✓✓✓
tx_isolation / tx_read_only variables

tx_isolation and tx_read_only were renamed transaction_isolation and transaction_read_only.

Fix: Use transaction_isolation (or SET TRANSACTION ISOLATION LEVEL …).

Tested with:

SELECT @@tx_isolation;
✓!✗✗✗✓✓✓✓
transaction_isolation / transaction_read_only variables

These are the newer names of tx_isolation / tx_read_only.

Fix: Use SET TRANSACTION ISOLATION LEVEL …, which works everywhere.

Tested with:

SELECT @@transaction_isolation;
✗✓✓✓✓✗✗✓✓
innodb_file_format / innodb_large_prefix

These InnoDB settings were removed; large index prefixes are always on.

Fix: Remove them.

Tested with:

SELECT @@innodb_large_prefix;
✓✓✗✗✗✗✗✗✗
expire_logs_days

expire_logs_days was replaced by binlog_expire_logs_seconds in MySQL.

Fix: Use binlog_expire_logs_seconds.

Tested with:

SELECT @@expire_logs_days;
✓✓!✗✗✓✓✓✓
default_authentication_plugin

default_authentication_plugin was replaced by authentication_policy in MySQL.

Fix: Use authentication_policy.

Tested with:

SELECT @@default_authentication_plugin;
✗✓!✗✗✗✗✗✗
log_warnings

log_warnings was replaced by log_error_verbosity in MySQL.

Fix: Use log_error_verbosity.

Tested with:

SELECT @@log_warnings;
✓!✗✗✗✓✓✓✓
Replication
SHOW MASTER STATUS / SHOW MASTER LOGS

MySQL renamed the MASTER/SLAVE statements.

Fix: Use SHOW BINARY LOG STATUS (MySQL) or SHOW BINLOG STATUS (MariaDB), and SHOW BINARY LOGS.

Tested with:

SHOW MASTER STATUS;
✓✓✓✗✗✓✓✓✓
SHOW BINARY LOG STATUS

SHOW BINARY LOG STATUS is the new name of SHOW MASTER STATUS.

Fix: Use SHOW MASTER STATUS on older servers.

Tested with:

SHOW BINARY LOG STATUS;
✗✗✗✓✓✗✗✗✓
SHOW SLAVE STATUS / SHOW SLAVE HOSTS

MySQL renamed the MASTER/SLAVE statements.

Fix: Use SHOW REPLICA STATUS.

Tested with:

SHOW SLAVE STATUS;
✓✓!✗✗✓✓✓✓
SHOW REPLICA STATUS / SHOW REPLICAS

SHOW REPLICA STATUS is the new name of SHOW SLAVE STATUS.

Fix: Use SHOW SLAVE STATUS on older servers.

Tested with:

SHOW REPLICA STATUS;
✗✗✓✓✓✓✓✓✓
CHANGE MASTER TO

MySQL renamed the MASTER/SLAVE statements.

Fix: Use CHANGE REPLICATION SOURCE TO SOURCE_HOST = ….

Tested with:

CHANGE MASTER TO MASTER_HOST = 'replica-source.invalid';
✓✓!✗✗✓✓✓✓
CHANGE REPLICATION SOURCE TO

CHANGE REPLICATION SOURCE TO is the new name of CHANGE MASTER TO.

Fix: Use CHANGE MASTER TO on older servers and on MariaDB.

Tested with:

CHANGE REPLICATION SOURCE TO SOURCE_HOST = 'replica-source.invalid';
✗✗✓✓✓✗✗✗✗
START SLAVE / STOP SLAVE

MySQL renamed the MASTER/SLAVE statements.

Fix: Use START REPLICA / STOP REPLICA.

Tested with:

STOP SLAVE;
✓✓!✗✗✓✓✓✓
RESET MASTER

MySQL renamed RESET MASTER.

Fix: Use RESET BINARY LOGS AND GTIDS.

Tested with:

RESET MASTER;
✓✓✓✗✗✓✓✓✓