Applicable to:
- Plesk for Windows
Question
How to enable the MariaDB slow query log on Windows Server with Plesk and analyze it?
Answer
-
Connect to a Plesk server via RDP.
-
Open the MariaDB installation folder. In Plesk for Windows, it is
%plesk_dir%Databases\MySQL\
. -
Open
my.ini
file located in this folder and add the following lines under the[mysqld]
section:CONFIG_TEXT: slow_query_log = 1
where long_query_time - time taken by an SQL query to be executed in seconds. If a query takes longer than the value specified, this query will be recorded in the slow query log file.
slow_query_log_file = slow-query.log
long_query_time = 2 -
In the same folder create the file
slow-query.log
. -
Restart MariaDB via Task Manager > Services or using Plesk Services Monitor:
-
Once restarted, start monitoring the slow query logfile
slow-query.log
created on step 4.
To learn more about the MariaDB slow query log, visit MariaDB Reference Manual: The Slow Query Log.
Note: How to enable the MySQL/MariaDB slow query log and analyze it on Linux
Comments
0 comments
Please sign in to leave a comment.