I'm getting an error when I ran mysql_secure_installation



  • I keep getting the following error on running sudo mysql_secure_installation

    ... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters.

    Any help will be appreciated.



  • Please follow below steps to fix the error.

    Login as a root user without using any password

    sudo mysql
    

    Then use the following command to change the authentication parameter:

    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mynewpassword'
    

    where mynewpassword is the new password you have set for root user, it would help to access and run installation again.

    Run again mysql_secure_installation to secure MySQL

    mysql_secure_installation
    

    once asked, enter the new set password for root user you recently did.

    Check for more details on https://dev.mysql.com/doc/internals/en/authentication-method.html ,https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_authentication_methods.html


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2