mysql_slow_query
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mysql_slow_query [2016/02/01 17:13] – luke7858 | mysql_slow_query [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| === Slow Query Logs === | === Slow Query Logs === | ||
| + | Checking the slow query logs via mysql prompt. | ||
| + | \\ | ||
| + | \\Note: You CAN enable the slow query logging on runtime. A mysql restart will flush the changes made via runtime. If you wish for persistence then add it to the /etc/my.cnf file: | ||
| + | <sxh bash> | ||
| + | mysql> SHOW GLOBAL VARIABLES LIKE ' | ||
| + | +---------------------+-------------------------------+ | ||
| + | | Variable_name | ||
| + | +---------------------+-------------------------------+ | ||
| + | | slow_query_log | ||
| + | | slow_query_log_file | / | ||
| + | +---------------------+-------------------------------+ | ||
| + | </ | ||
| + | Set the logs to another path: | ||
| + | <sxh bash> | ||
| + | mysql> SET GLOBAL slow_query_log_file = '/ | ||
| + | </ | ||
| + | <sxh bash> | ||
| + | mysql> SET GLOBAL slow_query_log = ' | ||
| + | </ | ||
| + | \\ | ||
| + | Via the command line: | ||
| + | \\ | ||
| + | \\ | ||
| You can check to see if slow query logging is currently enabled. The following command assumes you have configured .my.cnf file: | You can check to see if slow query logging is currently enabled. The following command assumes you have configured .my.cnf file: | ||
| <sxh bash> | <sxh bash> | ||
| - | show full variables like " | + | show variables like " |
| </ | </ | ||
| Or you can run the following from the command line: | Or you can run the following from the command line: | ||
| Line 53: | Line 76: | ||
| \\ | \\ | ||
| **__NOTE__**: | **__NOTE__**: | ||
| + | \\ | ||
| \\ | \\ | ||
| === Run-time Configuration === | === Run-time Configuration === | ||
mysql_slow_query.1454346802.txt.gz · Last modified: 2024/05/23 07:26 (external edit)
