ansible-role-mysql icon indicating copy to clipboard operation
ansible-role-mysql copied to clipboard

remove anonymous user in mysql_secure_installation fails with error 1045

Open schleicherdeha opened this issue 1 year ago • 0 comments

Here's the output of mysql_secure_installation:

[root@webserver~]# 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 you haven't set the root password yet, the password will be blank, so you should just press enter here.

Enter current password for root (enter for none): OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.

Remove anonymous users? [Y/n] ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) ... Failed! Cleaning up...

I did not set any variables in my playbook regarding mysql. Playbook had been running several times without errors. I didn't have this problem, when installing mysql/mariadb without ansible/awx.

Any help?

schleicherdeha avatar Sep 02 '24 15:09 schleicherdeha