0

I have mysql 8.0.29 installed and I am unable to set its root password using ansible. The documentation at https://docs.ansible.com/ansible/latest/collections/community/mysql/mysql_user_module.html#notes says

  1. change the root user’s password, without providing any login_user/login_password details

So my playbook goes like:

- mysql_user:
        login_user: ''
        login_password: ''
        name: root
        password: "password"
        priv: "*.*:ALL,GRANT"
        host: "{{ item }}"
      with_items:
        - "127.0.0.1"
        - "::1"
        - "localhost"

which returns

unable to connect to database, check login_user and login_******** are correct or /root/.my.cnf has the credentials. Exception message: (1698, \"Access denied for user 'root'@'localhost'\")"}

The other way I tried was setting skip-grant-tables in /etc/mysql/mysql.cnf file as below:

[mysqld]
skip-grant-tables

However when I fire command

mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';"

it returns error as:

ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded

I am absolutely clueless how to proceed ahead as the solutions people have tried on the internet are not working for me :-( Can anyone please help...

Ankur
  • 87
  • 7
  • `plugin-load-add = auth_socket.so` to the mysql.cnf file maybe – danblack Jul 27 '22 at 04:47
  • Have a look to https://stackoverflow.com/questions/37879448/mysql-fails-on-mysql-error-1524-hy000-plugin-auth-socket-is-not-loaded, sounds like you have the same issue. – Romain Jul 27 '22 at 05:01

0 Answers0