SQL syntax debug: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
How to debug SQL query syntax << [[PHP and MySQL syntax]]
How to debug MySQL query syntax


Goal:
* Reduce the complexity


Steps:
* Reduce the complexity of SQL syntax ex: reduce the {{ kbd | key = WHERE }} condition
* Reduce the complexity of SQL syntax ex: reduce the {{ kbd | key = WHERE }} condition
* Examine the sub query part only
* Enable the MySQL server log. Details on [[Testing#Database_server]]
* Enable the MySQL server log. Details on [[Testing#Database_server]]
* Disable unnecessary database operation permission
* Using the syntax highlight tool ex: Using the [http://www.sublimetext.com/ Sublime], and enable the Menu option: {{ kbd | key = View > Syntax >SQL }}. The syntax will become colorful for easy to read!
* Using the syntax highlight tool ex: Using the [http://www.sublimetext.com/ Sublime], and enable the Menu option: {{ kbd | key = View > Syntax >SQL }}. The syntax will become colorful for easy to read!



Revision as of 11:18, 26 August 2016

How to debug MySQL query syntax

Goal:

  • Reduce the complexity

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
  • Using the syntax highlight tool ex: Using the Sublime, and enable the Menu option: View > Syntax >SQL. The syntax will become colorful for easy to read!

MySQL server configuration