Access denied for user "@ ' localhost ' to database ' MySQL '. Find some methods on the net, finally fix.

Source: Internet
Author: User
Tags phpmyadmin

Reprint: http://blog.csdn.net/lilian129/article/details/9297881

These days with a blank password login mysql, and then modify the MySQL default password, the use of MySQL table has been the problem, hint: Error 1044 (42000): Access denied for user "@" localhost ' to database ' MySQL '. Find some methods on the net, finally fix.

I use XAMPP integrated MySQL, before the empty password can be logged into the phpMyAdmin, but how can not go to phpmyadmin system table

Later resolved the success of the discovery is because the user table of the MySQL database, the existence of the username is empty account is anonymous account, resulting in the login is the use of root, but the actual anonymous login, through the error prompt "@" localhost can be seen. I solved the problem with a method,

Method One:
In the My.ini [mysqld] field, add:
Skip-grant-tables
Restart the MySQL service when MySQL does not require a password to log in to the database
And then into MySQL.
Mysql>use MySQL;
Mysql>update user Set Password=password (' New password ') WHERE user= ' root ';
Mysql>flush privileges;
After running, finally remove the My.ini in the Skip-grant-tables, restart mysqld can be.


Modify MySQL Password method two:
Do not modify the MySQL password by using the non-service mode plus skip-grant-tables to run MySQL without modifying the My.ini method of restarting the service
Stop MySQL Service
Open a command-line window and start with Mysqld-nt.exe in the bin directory, which is executed at the command-line window: Mysqld-nt--skip-grant-tables
Then open a command-line window, log in to MySQL, no need to enter the MySQL password to enter.
After modifying the password as above, close the command line to run the MySQL window, this time the MySQL is turned off, if you find that MySQL is still running, you can end the process to close off.
Start the MySQL service.

Access denied for user "@ ' localhost ' to database ' MySQL '. Find some methods on the net, finally fix.

Related Article

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.