How to access MariaDB from a Linux systemd service without password
Hello,
I'm running MariaDB 10.3 on my Debian 10 (Buster) with configurations in /root/.my.cnf
[mysql]
<some users and password>
user=meyer
password=<root-password>
user=root
password=<root-password>
[mysqladmin]
user=root
password=<root-password>
[mysqldump]
user=root
password=<root-password>
[mysqlcheck]
user=root
password=<root-password>
[client]
user=root
password=<root-password>
I'm able to connect to the database without password from terminal or bash script with "mysql -u root" but not with "mysql -u meyer". This is what I want. But if I start the bash script as a service I get the error "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)" Do I have to configure something to enable passwordless root access from a service?
Thanks in advance Matthias