Access denied for user ' root ' @ ' localhost ' (using password:yes) solution

Source: Internet
Author: User

About yesterday afternoon said the MySQL service can not start the problem, after the solution did not enter the database, the computer directly shut down.

Turn on the computer this morning. The following error occurred after running the input "mysql-uroot-pmyadmin": "Access denied for user ' root ' @ ' localhost ' (using password:yes)" Direct input " MySQL "also returns similar error:" Access denied for user ' ODBC ' @ ' localhost ' (using password:no) "Specific don't remember, seems to be this. About this problem, looked for a long time solution, also changed the disk rename characters installed several times, the problem is still. There is a network of MySQL 5.5 Command line Client open MySQL, in the inside a series of operations can. However, this interface will enter the password:
Exit directly regardless of what you enter. It's not gone. (Oh, by the time I tried, I didn't set the password when I installed MySQL.) After the installation is successful, it is still an error. See a lot of solutions on the Internet, not all. Finally, the combination of some methods, finally solve the problem. As far as I'm doing, right? I don't know, but it did solve the problem. Maybe there are other better solutions, and if the brothers and sisters know it, I would appreciate it if I could share it with you. Solution: 1. Open the My.ini file in the MySQL directory, add a line "Skip-grant-tables" at the end of the file, save and close the file. 2. Restart the MySQL service. 3, enter "Mysql-uroot-p" in the command line (do not enter a password), enter the database. 4, execute, "use MySQL;" Use the MySQL database. 5. Execute, "Update user set Password=password (" Rootadmin ") where user= ' root '; (Change the root password) (during the period I also select the record in the user table, query all the time shows some garbled, and then I only query the user table in the host, user, password field, it seems to show 3 records, there are 1 No name.) Of course, in order to solve the problem, I can not control it. 6. Open the My.ini file in the MySQL directory, delete the last line of "Skip-grant-tables", save and close the file. 7. Restart the MySQL service.  8, enter "Mysql-uroot-prootadmin" in the command line, the problem is done! Transferred from: http://blog.csdn.net/ldl22847/article/details/7941962

Access denied for user ' root ' @ ' localhost ' (using password:yes) solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.