Alexander Farber
2020-Dec-05 14:35 UTC
[CentOS] CentOS 8.2: error running non-shared postrotate script for /var/log/mysql/mysqld.log
Hello fellow CentOS users! I have installed CentOS 8.2.2004 with the following packages: mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 mysql-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 mysql-errmsg-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 Then I have run mysql_secure_installation and among other things set the root password for MySQL As result I am greeted with the following anachron mail every morning: /etc/cron.daily/logrotate: mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)' error: error running non-shared postrotate script for /var/log/mysql/mysqld.log of '/var/log/mysql/mysqld.log ' I understand that the reason is me having set the root password for MySQL. But my question is how to provide the password to postrotate without disclosing it too much? Other than that the MySQL works well, I use it to host 3 Wordpress websites at my CentOS 8 Linux server (haproxy -> Jetty x 3 -> FastCGI -> php-fpm -> Wordpress -> MySQL) Greetings from Germany Alex
Leon Fauster
2020-Dec-05 17:17 UTC
[CentOS] CentOS 8.2: error running non-shared postrotate script for /var/log/mysql/mysqld.log
Am 05.12.20 um 15:35 schrieb Alexander Farber:> Hello fellow CentOS users! > > I have installed CentOS 8.2.2004 with the following packages: > > mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 > mysql-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 > mysql-errmsg-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 > mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 > > Then I have run mysql_secure_installation and among other things set the > root password for MySQL > > As result I am greeted with the following anachron mail every morning: > > /etc/cron.daily/logrotate: > > mysqladmin: connect to server at 'localhost' failed > error: 'Access denied for user 'root'@'localhost' (using password: NO)' > error: error running non-shared postrotate script for > /var/log/mysql/mysqld.log of '/var/log/mysql/mysqld.log ' > > I understand that the reason is me having set the root password for MySQL. > > But my question is how to provide the password to postrotate without > disclosing it too much? > > Other than that the MySQL works well, I use it to host 3 Wordpress websites > at my CentOS 8 Linux server (haproxy -> Jetty x 3 -> FastCGI -> php-fpm -> > Wordpress -> MySQL) > > Greetings from Germany > AlexHallo Alex, take a look into /etc/logrotate.d/mysqld -- Leon
Anthony K
2020-Dec-07 09:48 UTC
[CentOS] CentOS 8.2: error running non-shared postrotate script for /var/log/mysql/mysqld.log
On 6/12/20 1:35 am, Alexander Farber wrote:> But my question is how to provide the password to postrotate without > disclosing it too much? > >Maybe using unix_socket for root user? https://dev.mysql.com/doc/mysql-secure-deployment-guide/8.0/en/secure-deployment-configure-authentication.html
Tony Mountifield
2020-Dec-07 23:13 UTC
[CentOS] CentOS 8.2: error running non-shared postrotate script for /var/log/mysql/mysqld.log
In article <CAADeyWiCwqYtdnkAkSkoKzmh8jmQobmCx6ehz0XOwJZB1HuFtg at mail.gmail.com>, Alexander Farber <alexander.farber at gmail.com> wrote:> Hello fellow CentOS users! > > I have installed CentOS 8.2.2004 with the following packages: > > mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 > mysql-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 > mysql-errmsg-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 > mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 > > Then I have run mysql_secure_installation and among other things set the > root password for MySQL > > As result I am greeted with the following anachron mail every morning: > > /etc/cron.daily/logrotate: > > mysqladmin: connect to server at 'localhost' failed > error: 'Access denied for user 'root'@'localhost' (using password: NO)' > error: error running non-shared postrotate script for > /var/log/mysql/mysqld.log of '/var/log/mysql/mysqld.log ' > > I understand that the reason is me having set the root password for MySQL. > > But my question is how to provide the password to postrotate without > disclosing it too much?Create a file .my.cnf owned by root with permission 600, containing these lines: [mysqladmin] user = root password = YourMySqlRootPassword You need to put it in / or in /root - I usually do both, as I think logrotate has / as it's home dir instead of /root. Then logrotate can call mysqladmin without having to give a password. Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org