SQL syntax debug
Jump to navigation
Jump to search
How to debug MySQL query syntax
Approach 1: Reduce the complexity of Sql query
Steps:
- Reduce the complexity of SQL syntax ex: reduce the WHERE condition
- Examine the sub query part only
- Enable the MySQL server log. Details on Testing#Database_server
- Disable unnecessary database operation permission
Approach 2: Using MySQL syntax checker
Approach 3: Beautify the Sql syntax
- Using the text editor Sublime, and enable the Menu option: View > Syntax >SQL. The syntax will become colorful for easy to read!
- Instant SQL Formatter
MySQL server configuration
Further reading
- Craig Kerstiens (2016). Writing more legible SQL [Last visited: 2016-11-03]