While I NEVER experienced any problems with this on several Debian 8 machines and even Windows, I now simply can't manage to get a working installation of MariaDB/MySQL on my fresh installation of Debian 9 Stretch.
In my first installation I couldn't get access to the root account of mysql. Since then I tried a lot.
My Password Reset Attempts included among others the following:
https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html https://www.howtoforge.com/setting-changing-resetting-mysql-root-passwords https://help.ubuntu.com/community/MysqlPasswordReset https://www.digitalocean.com/community/tutorials/how-to-reset-your-mysql-or-mariadb-root-password mysql how to fix Access denied for user 'root'@'localhost'
As that all didn't work I then gave up and started several attempts to entirely reinstall first just the mariadb/mysql packages, then all LaMp related packages.
I therefore first purged all packages
sudo apt-get remove --purge *mariadb* *mysql* *php* apache2 phpmyadmin
sudo apt-get autoremove
sudo apt-get clean
(this is the most drastic attempt i have chosen)
And afterwards I followed those installation tutorials
http://www.pcsystembetreuer.de/cms-online-designer/lamp-debian-9-stretch.html http://www.itzgeek.com/how-tos/linux/debian/how-to-install-lamp-server-on-debian-9-stretch.html https://linuxconfig.org/how-to-install-a-lamp-server-on-debian-9-stretch-linux
Again, none of the above worked for me.
To be more specific: I can't log into the root user of mariadb if i am not the root user of my system. Though, in case of the latter I could even log in if the password i provide would be completely wrong.
I've set up the password with e.g. mysql_secure_installation as the root user. If I try to run this command as my normal user, I get told that I did not provide the correct old password to change it. Though there is no old password as I've never set any password and even just did a clean install of mariadb.
As much as I try and search through similar problems I can't manage to find a way that works for me and am right now close to insanity (following the definition that sanity is when you try the same thing over and over again expecting different results.).
I don't need any "safe solutions" as I have no DBs that could be deleted yet. Perfect for me would be a CLEAN installation that gets rid of any - apparently existing - old configuration files storing a mysterious password that I don't know. Or, I just do something entirely wrong. Just don't know what.