When you first install MySQL or MariaDB, root password is set to blank. So when you are trying to use a command such as
mysql_secure_installation, you should be able to log into the root user account just by leaving it empty and hit ENTER. But you are here because it doesn’t work, right?
Instead of running
run the command with
$ sudo mysql_secure_installation