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!
Hi there,
You should be able to resolve this by following these steps:
Start a new MySQL session:
sudo mysql
Run the following SQL query:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your-password-here';
exit
Note: change the
your-password-herewith an actual secure password
Then run the mysql_secure_installation command again:
sudo mysql_secure_installation
When needed enter the your-password-here
Let me know how it goes!
Best,
Bobby
Hey @jrmurchin,
That’s easily resolvable, don’t worry.
- sudo mysql
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.