MySQL Syntax Checker — Validate SQL Queries

Paste your queries and press “Check SQL” to find syntax errors.

Your text and files never leave your browser — nothing is sent to a server.

How to use

  1. Paste SQL and press “Check SQL”. Several statements separated by semicolons are checked together.
  2. If the syntax is valid, you see the number of statements and the type of each (SELECT, UPDATE and so on).
  3. If not, the problem is marked with ^ and you get the line, column and the keywords that could appear there.
  4. Choose MySQL or MariaDB under “Database”.

FAQ

Does it support every MySQL statement?

Queries are read by an open-source SQL parser (node-sql-parser), which handles common statements such as SELECT, INSERT, UPDATE, DELETE and CREATE TABLE. DELIMITER is understood, and stored procedures, functions, triggers and events are skipped without checking their bodies. Admin statements such as SET NAMES, SHOW and FLUSH, and the PARTITION part of table definitions, are skipped too. Other rare syntax may be reported as an error even when it is valid.

Does a pass mean the query will run?

Not necessarily. Only syntax is checked. Table and column names, data types, permissions and constraint violations are confirmed only when you run the query on a real database.

Is my query sent to a database or server?

No. The browser only parses the text; nothing is uploaded or executed.

Related tools

All tools