Mysql_secure_installation broken?

I’ve just installed mariadb and ran the script mysql_secure_installation:

$ mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none): 
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Enter current password for root (enter for none): 
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Enter current password for root (enter for none): 
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Enter current password for root (enter for none):

Is this working as intended? (I’ve just pressed enter…)

On fedora workstation the root user is deliberately locked out by default.
Try actually creating a root user password sudo passwd root then repeat the mysql action with a valid root password.

You are supposed to run it with elevated privileges:

sudo mysql_secure_installation
1 Like

Wait.
Enter current password for root (enter for none):
It eventually asks for the mariadb’s root user (which is not set, just press enter is correct), and not the system’s root user. So there is no need to unlock the system’s root user.
The way to go is the one suggested by @vgaetera: sudo mysql_secure_installation