Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

MySQL Syntax Checker

Validate MySQL queries before you run them. The checker parses each statement with the MySQL grammar and shows where it breaks — backticks, LIMIT, ON DUPLICATE KEY UPDATE and all.

Mis à jour le

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : MySQL Syntax Checker

  1. Choose your database dialect (MySQL, PostgreSQL, SQL Server, SQLite, BigQuery and more).
  2. Paste or open your SQL — several statements separated by semicolons are fine.
  3. Errors show the line, column and the expected tokens, with the faulty spot marked.
  4. Valid statements are listed with their type and the tables they touch, plus warnings for risky patterns.

What does a SQL validator check?

A SQL validator (or syntax checker) parses your query with the grammar of a specific database and tells you whether it is well formed: balanced parentheses, keywords in the right order, valid expressions, commas between columns and so on. This one splits your script into statements, parses each one separately so you see every broken statement at once, and points at the line and column where parsing stopped. The MySQL grammar is selected by default.

Best-practice warnings

WarningWhy it matters
UPDATE / DELETE without WHEREChanges every row in the table — usually a mistake.
SELECT *Fetches columns you may not need and breaks when columns are added or reordered.
INSERT without a column listDepends on column order; adding a column breaks it.
LIKE '%…'A leading wildcard cannot use a normal index and scans the table.
= NULLNever true; use IS NULL.
ORDER BY without LIMIT in a subquery, or LIMIT without ORDER BYRow order is not guaranteed without an explicit sort.

Dialect differences that cause errors

  • Identifier quotes — MySQL and MariaDB use backticks (`order`), PostgreSQL, SQLite and the SQL standard use double quotes, SQL Server uses square brackets ([order]).
  • Row limits — LIMIT 10 in MySQL, PostgreSQL and SQLite; TOP 10 or OFFSET … FETCH in SQL Server.
  • Upserts — ON DUPLICATE KEY UPDATE (MySQL) vs ON CONFLICT … DO UPDATE (PostgreSQL, SQLite) vs MERGE (SQL Server, Snowflake, BigQuery).
  • Casts — PostgreSQL accepts value::int; most others need CAST(value AS INT).

Common MySQL syntax errors

MySQL’s own message, “You have an error in your SQL syntax… near '…' at line 1”, quotes the text from the point where parsing failed. Frequent causes are reserved words used as names (order, group, key — wrap them in backticks), a trailing comma before FROM, double quotes for identifiers (MySQL treats them as strings unless ANSI_QUOTES is on) and a missing comma between columns.

Make the query readable with the SQL formatter, generate statements from data with CSV to SQL or JSON to SQL, and design tables with the CREATE TABLE generator.

Aussi recherché comme : mysql query validator, check mysql syntax, mysql syntax error, mysql linter, mariadb syntax checker.

Outils complémentaires : MySQL Syntax Checker

  • SQL Validator — Paste one query or a whole script to check its syntax against the grammar of your database.
  • PostgreSQL Syntax Checker — Validate PostgreSQL queries in your browser.
  • Excel to JSON — Open an .xlsx workbook or paste cells straight from Excel or Google Sheets and get clean JSON.
  • JSON to Excel — Turn a JSON array into a real Excel workbook.

Questions fréquentes

Is my SQL sent to a server or a database?
No. The query is parsed in your browser with the open-source node-sql-parser grammar. Nothing is uploaded and nothing is executed.
Does a valid result mean the query will run?
It means the syntax is valid for the selected dialect. The validator does not know your schema, so a misspelt table or column name, missing permissions or type mismatches only show up when the database runs it.
Why does the error point after my mistake?
A parser reports the first token it cannot fit into the grammar. A misspelt keyword such as WHER is often read as an alias, so the error appears on the next word. Check the token just before the marked position too.
Which statements are supported?
SELECT (with joins, subqueries, CTEs, window functions, UNION), INSERT, UPDATE, DELETE, REPLACE, CREATE / ALTER / DROP TABLE, CREATE INDEX and VIEW, TRUNCATE, USE and more, depending on the dialect. Stored procedures and vendor-specific procedural blocks are not fully covered.
Puis-je installer MySQL Syntax Checker en tant qu’application web et l’utiliser hors ligne ?
Oui. MySQL Syntax Checker est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires