I never thought about this before. I use a password manager for all my accounts (web/server-admin/etc).
But today I was reading about installing a Nextcloud in a Debian server, and it's stated:
You should save your MariaDB root username and password in a .my.cnf file, as this will enable you to log in to MariaDB and execute SQL commands without a password prompt.
@ How to Install Nextcloud 12 Server on Debian 9 with HTTPS
Should I?
Looking for an answer to this question, I found this: mysql root password - where should it be stored?, where they imply this is a normal situation.
I already ran the mysql_secure_installation
script. So, the root password is already changed. Should I put this password in this /root/.my.cnf
file?
Is there more information about this somewhere? I find it really difficult to believe: storing password in plain text in my server seems a very bad idea to me.
Update: I think it wasn't clear enough. My mistake. So, I would like to clarify: I'm not logged in into my server as root. In fact, it is disabled, I have my user within the sudoers group. And I create a user database for each database I'm creating within the server. As I already stated: I ran the script to secure the database.