Linux – Debian thesql-server is not asking for a root password before installation

debianlinuxMySQL

I installed mysql-server and it did not ask for a root password, and now i can't log into MySQL as root. Also, i noticed, that command "mysql_secure_installation" wants to secure a MariaDB database root account, not a MySQL one. I have been trying for days, but nobody could help me anywhere. What may the solution be? (Debian 9)

Best Answer

After initial installation you should run mysql_secure_installation to set a password for root accounts. https://mariadb.com/kb/en/mariadb/mysql_secure_installation/

MariaDB Server is the default fork of MySQL in Debian 9.

https://www.debian.org/releases/stretch/amd64/release-notes/ch-whats-new.en.html#mariadb-replaces-mysql

https://mariadb.com/resources/blog/mariadb-server-default-debian-9

In Debian 9 "Stretch" the mysql-server package depends on a new package called default-mysql-server. This package in turn depends on mariadb-server-10.1.

[..] when you install the mysql-server package on Stretch you will get MariaDB 10.1 instead of MySQL, like you would with previous versions of Debian. Note that mysql-server is just an empty transitional meta-package and users are encouraged to install MariaDB using the actual package mariadb-server.

source: https://mariadb.com/kb/en/library/moving-from-mysql-to-mariadb-in-debian-9/