Report this

What is the reason for this report?

sudo mysql_secure_installation

Posted on June 7, 2023
JRM

By JRM

As I was following the tutorial on installing a LAMP server I got to this command:

sudo mysql_secure_installation

and when prompted for a New password it returns this error message:

New password:

Re-enter new password: … 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 ideas out there?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

You should be able to resolve this by following these steps:

  1. Start a new MySQL session:

    sudo mysql
    
  2. Run the following SQL query:

    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your-password-here';
    exit
    

    Note: change the your-password-here with an actual secure password

  3. Then run the mysql_secure_installation command again:

    sudo mysql_secure_installation
    
  4. When needed enter the your-password-here

Let me know how it goes!

Best,

Bobby

Hey @jrmurchin,

That’s easily resolvable, don’t worry.

  1. Start the mysql client:
  1. sudo mysql
  1. Run the following SQL query:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'SetRootPasswordHere';
exit

Replace SetRootPasswordHere with your actual password. 5. Then run the following command to secure it:

sudo mysql_secure_installation
  1. When promoted for the password enter the whatever you set when you ran the above SQL query
  2. That is all.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.