iamnoob With MariaDB 10.5 the my.conf is replaced by /etc/mysql/mariadb.conf.d/50-server.cnf. But on your server there is something wrong because you should be able to login only with the command mysql as root, because credentials are set in /etc/mysql/conf.d/my.cnf.
You can try to copy /etc/mysql/conf.d/my.cnf to /root/my.cnf
cp -f /etc/mysql/conf.d/my.cnf /root/my.cnf
And to try again to use mysqltuner