Skip to content
Snippets Groups Projects
Commit b6507ee1 authored by Sean Madsen's avatar Sean Madsen Committed by GitHub
Browse files

Merge pull request #126 from fuzionnz/mysql_query_log

MySQL query log
parents 954ab852 93f39cc8
No related branches found
No related tags found
No related merge requests found
......@@ -84,11 +84,31 @@ The following values can be added to your site's settings file `civicrm.settings
## Viewing a query log from MySQL
Outside of CiviCRM, the MySQL database software has features to enable the logging of all queries it receives.
*TODO: how do we enable?*
Outside of CiviCRM, the MySQL general query log allows MySQL to log all queries. This is a performance killer, so avoid using it in production!
* [MySQL reference: General Query Log](https://dev.mysql.com/doc/refman/en/query-log.html)
The relevant settings are:
# Location of the query log
general_log_file=/tmp/mysql.log
# Enable/disable the query log
general_log=1
You can enable the query log at runtime via SQL, provided the path to the logfile is configured.
SET GLOBAL general_log = 'ON';
SET GLOBAL general_log = 'OFF';
And you can inspect the query log settings also:
mysql> show variables like '%general%';
+------------------+---------------------------------+
| Variable_name | Value |
+------------------+---------------------------------+
| general_log | OFF |
| general_log_file | /usr/local/var/mysql/strike.log |
+------------------+---------------------------------+
## Changing source code
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment