# PMM2 apt installation turns of slow query log

**URL:** <https://forums.percona.com/t/pmm2-apt-installation-turns-of-slow-query-log/7685>\
**Category:** PMM 2.x\
**Created:** [June 16, 2020, 10:12am UTC](https://forums.percona.com/t/pmm2-apt-installation-turns-of-slow-query-log/7685 "2020-06-16T10:12:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![steffen](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@steffen](https://forums.percona.com/u/steffen)\
**Post date:** [June 16, 2020, 10:12am UTC](https://forums.percona.com/t/pmm2-apt-installation-turns-of-slow-query-log/7685/1 "2020-06-16T10:12:21Z")

</div>

Hi,  
I upgraded the PMM clients on several Debian servers (9.11 and 9.12) running MySQL 5.6 and 5.7 from PMM1 to PMM2, using the Percona repository. Basically “apt update; apt install pmm2-client”.  
I noticed on every one of those servers that the MySQL slow query log became disabled after running “apt install pmm2-client”.  
Is that a bug or a feature I don’t understand?  
Greetings,  
Steffen

---

<div class="post-metadata">

**Author:** ![Peter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/peter/32/2_2.png) [@Peter](https://forums.percona.com/u/Peter)\
**Post date:** [June 16, 2020, 10:19am UTC](https://forums.percona.com/t/pmm2-apt-installation-turns-of-slow-query-log/7685/2 "2020-06-16T10:19:24Z")

</div>

Are you sure it is PMM2 installation NOT PMM1 Removal which disabled Slow Query Log ?&nbsp;

---

<div class="post-metadata">

**Author:** ![steffen](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@steffen](https://forums.percona.com/u/steffen)\
**Post date:** [June 16, 2020, 10:41am UTC](https://forums.percona.com/t/pmm2-apt-installation-turns-of-slow-query-log/7685/3 "2020-06-16T10:41:33Z")

</div>

Can’t tell, since “apt install pmm2-client” does both in one step.  
But either way, I had slow query log enabled even before installing the pmm1 clients, so it think it’s not good to disable it when uninstalling. Luckily I have a custom dashboard that shows me all those flags, so I noticed right away.If it is an expected behavior, maybe you should add a hint to the docs or the blog posts about the upgrading process.

---

<div class="post-metadata">

**Author:** ![lalit.choudhary](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lalit.choudhary/32/51_2.png) [@lalit.choudhary](https://forums.percona.com/u/lalit.choudhary)\
**Post date:** [June 17, 2020, 3:27am UTC](https://forums.percona.com/t/pmm2-apt-installation-turns-of-slow-query-log/7685/4 "2020-06-17T03:27:07Z")

</div>

Hi&nbsp; @steffen   
I do not see the described case in my test, tested on Debian 9 and ubuntu18 with mysql 5.7 version with slow+log enabled. upgrading from pmm1 to pmm 2 client using apt install not affecting slow\_log settings in mysql.&nbsp;  
  
Test:  
# cat /etc/debian\_version&nbsp;9.6mysql 5.7.30mysql\> show variables like ‘%slow%’;±--------------------------±----------------------------------------+| Variable\_name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| Value&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|±--------------------------±----------------------------------------+| log\_slow\_admin\_statements | OFF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| log\_slow\_slave\_statements | OFF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| slow\_launch\_time&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| slow\_query\_log&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | ON&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; || slow\_query\_log\_file&nbsp; &nbsp; &nbsp; &nbsp;| /var/lib/mysql/ip-172-30-3-190-slow.log |±--------------------------±----------------------------------------+5 rows in set (0.00 sec)  
mysql\> exitBye# apt install pmm2-clientReading package lists… DoneBuilding dependency tree&nbsp; &nbsp; &nbsp; &nbsp;Reading state information… DoneThe following packages were automatically installed and are no longer required:&nbsp; galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libencode-locale-perl libfcgi-perl libhtml-parser-perl&nbsp; libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl libjemalloc1 liblwp-mediatypes-perl libmariadbclient18&nbsp; libreadline5 libterm-readkey-perl libtimedate-perl liburi-perl lsof mariadb-common rsync socatUse ‘apt autoremove’ to remove them.The following packages will be REMOVED:&nbsp; pmm-clientThe following NEW packages will be installed:&nbsp; pmm2-client0 upgraded, 1 newly installed, 1 to remove and 87 not upgraded.Need to get 0 B/61.8 MB of archives.After this operation, 94.8 MB of additional disk space will be used.Do you want to continue? [Y/n] y(Reading database … 36685 files and directories currently installed.)Removing pmm-client (1.17.3-1.stretch) …OK, no services found.Uninstall complete.Selecting previously unselected package pmm2-client.(Reading database … 36664 files and directories currently installed.)Preparing to unpack …/pmm2-client\_2.7.0-6.stretch\_amd64.deb …Unpacking pmm2-client (2.7.0-6.stretch) …Setting up pmm2-client (2.7.0-6.stretch) …root@ip-172-30-3-190:~# mysql -u root -pEnter password:&nbsp;Welcome to the MySQL monitor.&nbsp; Commands end with ; or \g.Your MySQL connection id is 4Server version: 5.7.30 MySQL Community Server (GPL)  
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.  
Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.  
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.  
mysql\> show variables like ‘%slow%’;±--------------------------±----------------------------------------+| Variable\_name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| Value&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|±--------------------------±----------------------------------------+| log\_slow\_admin\_statements | OFF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| log\_slow\_slave\_statements | OFF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| slow\_launch\_time&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| slow\_query\_log&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | ON&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; || slow\_query\_log\_file&nbsp; &nbsp; &nbsp; &nbsp;| /var/lib/mysql/ip-172-30-3-190-slow.log |±--------------------------±----------------------------------------+5 rows in set (0.00 sec)

---

<div class="post-metadata">

**Author:** ![steffen](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@steffen](https://forums.percona.com/u/steffen)\
**Post date:** [June 17, 2020, 6:10am UTC](https://forums.percona.com/t/pmm2-apt-installation-turns-of-slow-query-log/7685/5 "2020-06-17T06:10:25Z")

</div>

Hi Lalit,  
  
here are the log excerpts from my upgrade (Debian 9.11, MySQL 5.6.46):  
  
apt update  
apt install percona-release  
# Unpacking percona-release (1.0-19.generic) over (1.0-13.generic) …  
apt update  
apt list --upgradable  
# pmm-client/unknown 1.17.3-1.stretch amd64 [upgradable from: 1.17.2-1.stretch]  
  
pmm-admin annotate “db01 replacing PMM client 1.17.2 with 2.6.1”   
apt install pmm2-client  
# The following packages will be REMOVED:  
#&nbsp;&nbsp; pmm-client  
# The following NEW packages will be installed:  
#&nbsp;&nbsp; pmm2-client  
  
# Get:1 [Percona Repo](http://repo.percona.com/percona/apt) stretch/main amd64 pmm2-client amd64 2.7.0-6.stretch [61.8 MB]  
# Fetched 61.8 MB in 13s (4,677 kB/s)  
# Removing pmm-client (1.17.2-1.stretch) …  
# OK, 3 services were removed.  
# Uninstall complete.  
# Selecting previously unselected package pmm2-client.  
# Preparing to unpack …/pmm2-client\_2.7.0-6.stretch\_amd64.deb …  
# Warning: The home dir /usr/local/percona you specified already exists.  
# Adding system user `pmm-agent' (UID 114) ...<br># Adding new group `pmm-agent’ (GID 119) …  
# Adding new user `pmm-agent' (UID 114) with group `pmm-agent’ …  
# The home directory `/usr/local/percona' already exists.&nbsp; Not copying from `/etc/skel’.  
# adduser: Warning: The home directory `/usr/local/percona’ does not belong to the user you are currently creating.  
# Setting up pmm2-client (2.7.0-6.stretch) …  
# Created symlink /etc/systemd/system/multi-user.target.wants/pmm-agent.service ? /lib/systemd/system/pmm-agent.service.  
  
  
After that I checked and found slow\_query\_log was set to 0, and it definitely was 1 before.  
I checked the Prometheus graphs: The 0 was also set on our servers running 5.7, so it’s not an issue of 5.6.  
But if it’s not a common problem, then it’s probably not worth the effort to try and figure out what exactly in our configuration caused it.

---

<div class="post-metadata">

**Author:** ![lalit.choudhary](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lalit.choudhary/32/51_2.png) [@lalit.choudhary](https://forums.percona.com/u/lalit.choudhary)\
**Post date:** [June 18, 2020, 3:58am UTC](https://forums.percona.com/t/pmm2-apt-installation-turns-of-slow-query-log/7685/6 "2020-06-18T03:58:52Z")

</div>

Hi Steffen,  
It’s very unlikely that pmm-client installation/Removal will impact mysql setting because, in order to change mysql setting dynamically without restart mysqld server, it must access mysql and do the changes.&nbsp; I will see if can do some more tests.  
Thanks

---

<div class="post-metadata">

**Author:** ![lalit.choudhary](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lalit.choudhary/32/51_2.png) [@lalit.choudhary](https://forums.percona.com/u/lalit.choudhary)\
**Post date:** [June 18, 2020, 8:50am UTC](https://forums.percona.com/t/pmm2-apt-installation-turns-of-slow-query-log/7685/7 "2020-06-18T08:50:48Z")

</div>

Hi Steffen,  
I am able to reproduce it and reported this as a bug. The issue only with pmm-client (PMM1)  
[https://jira.percona.com/browse/PMM-6158](https://jira.percona.com/browse/PMM-6158 "Link: https://jira.percona.com/browse/PMM-6158")
