CentOS 7 log rotation broken after replacing the stock MySQL server with Percona 5.7

It basically seems to be a common problem, but I didn’t manage to selve this in case of Percona.

What happens is that I get the message

[root@languagecourse]# mysqladmin flush-logs
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘root’@‘localhost’ (using password: YES)’

on the command up…and the story started when it stopped rotating the logs. Te root permissions are fine, I have also created an .my.sql file in /root/ with [mysqladmin] section and the proper credentials, but it still doesn’t work.
After that, I have inserted the same [mysqladmin] section in the main /etc/my.cnf file, restarted mysqld and I still get the same issue.

If anyone get an idea, please, I need a “4 eye method” for this, as I can’t tell what am I doing wrong, and I need it to log.


I’ve solved my own issue with this by simply adding the credentials into the command line.
It didn’t work any other way. Maybe because I had a # character in the password, dunno… This was the only way I could solve this.