• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Issue Slown queries with mariadb

Erwan

Regular Pleskian
Hi all,

I want to log slow queries from Mariab (Plesk Onyx 17.8 - 5.5.60-MariaDB version 10).
I have updated the file /etc/my.cnf with:

slow_query_log = 1
log-slow-queries = /var/log/mysql-slow.log
long_query_time = 2

And after restarted Mariadb:
#service mariadb restart

All like that: How to enable the MySQL slow query log and analyze it on Linux

But nothing in the file. And in PhpMyAdmin we have:
Slow queries => 7

And in the advices, we have:

"... the value of long_query_time is 10 seconds..."
"... the log_slow_queries is OFF..."

Is there another file for the mariadb configuration?
How can i log the slow query?
 
the specs you modified in my.cnf should be enough. Can you check if the user under which the MariaDB service is running under has the permissions to modify /var/log/mysql-slow.log? The log file should have the same user.group as the Mariadb user/group.
 
Thanks Mihai.

We have given "mysql:mysql" to the file. It seems good.

And i don't understand that in PhpMyAdmin we have "log_slow_queries => OFF" and in "my.cnf" slow_query_log = 1.
It's as if the changes in my.cnf haven't no effect...
 
Hi Erwan,

Make sure you place those variables under [mysqld] and not under [mysqld_safe] directive, and you don't duplicate those variables with different values.
 
Last edited:
Back
Top