mysql: still can't login after root password reset
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
ok, after several hair-pulling-out-in-frustration days i've managed to crack this one so here's the answer IF anybody happens to be interested. The insert to change your password must be in the format:
update mysql.user set password=PASSWORD('password') where user='root';
note the password() function. i'm amazed nobody could help me on this one, on all the forums where i looked the function was not used so the password is inserted in plain text.
Almost 9 years later, I created a new account on this forum just to thank you for the time you took to write the solution to my problem! I spent around 5-6 hours trying to figure this out reading dozens of articles and documentation and thanks to you I was able to solve this problem (which took many production servers down).
And yes, if you get the error "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)" you need to:
1. Stop mysqld, type skip-grant-tables under [mysqld] within the /etc/my.cnf file.
2. Start mysqld
3. login with root mysql -u root -p
4. enter the following command: update mysql.user set password=PASSWORD('password') where user='root';
3. flush privileges
4. restart mysqld
Also, do not forget to erase the "mysql.log" file after you're done. (You must exit "mysql" command first.) Otherwise the command you just entered will be there along with the password.
mysql: still can't login after root password reset
Hi,
@Den
If you add skip-grant-tables under [mysqld] within the /etc/my.cnf file, and do below:
2. Start mysqld
3. login with root mysql -u root -p
4. enter the following command: update mysql.user set password=PASSWORD('password') where user='root';
3. flush privileges
4. restart mysqld
wont fix the issue because it will give an access to any password for root user. Feel free to give it a try.
login with root mysql -u root -p
and type any password and see you will be at mysql prompt which should not happen.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.