logrotate fails when mariadb is secured with a root account password...

October 9, 2020 - Reading time: ~1 minute

Mariadb is recommended to run mysql_secure_installation to set a root password and disable access form the network and remove all the evaluation databases and users.

When I found the errors in the journal (systemd) that logrotate could not authenticate against the root mariadb account to complete the log rotate.

A lot of searching later I found this page --> https://mariadb.com/kb/en/authentication-plugin-unix-socket/

After a bit of reading I found the server needs to have the --unix-socket=ON option to allow the user of logrotate to access the password for the root account of the database.

the format of the /root/.my.cnf file is as follows:

[client]

user = root

password = "YOUR_PASSWORD"

And that's it...

LazyCoderOZ

I am a Linux guy, been around for 20+ years using Linux as my daily driver.
This is my blog on my discoveries and notes so I don't forget how I have done things :)