September 25

MYSQL: Resetting the root user in MYSQL

ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

1.stop mysql service with “service mysqld stop”
2.start mysql service with “/usr/local/mysql/bin/mysqld_safe –skip-grant-tables & ”
3.Login mysql with “mysql -u root -p”
4.These are finished in mysql command line:
USE mysql;
UPDATE user SET Password=PASSWORD(‘newpassword’) where USER=’root’;
5.restart mysql service with “service mysqld restart”

Now you can login with mysql -u root -p

By: ccieyezhu

Copyright 2021. All rights reserved.

Posted September 25, 2014 by Timothy Conrad in category "Databases

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. Securely email me using - PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B