SQL syntax debug: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
Line 23: Line 23:
MySQL server configuration
MySQL server configuration
* [http://mysqltuner.com/ MySQLTuner-perl by major]
* [http://mysqltuner.com/ MySQLTuner-perl by major]
* [[Troubleshooting of MySQLTuner]]


Further reading
Further reading

Revision as of 11:47, 27 January 2018

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

Beautify the SQL syntax for better readability.

  • 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

Related articles

MySQL server configuration

Further reading