MySQL error:access denied for user ' root ' @ ' localhost ' (using Password:yes)

Source: Internet
Author: User

Yesterday reinstall the next system, after installing MySQL, installed a client tool to connect to MySQL, prompting access denied for user ' root ' @ ' localhost ' (using Password:yes)

Find some solutions on the Internet, all of them are solutions under the Linux system confused.

Here's how Windows solves

1. Admin login system, stop MySQL service or end mysqld-nt process
2. Go to the command line and come to the MySQL installation directory. Assuming that the installation directory is C:\Program Files (x86) \mysql\mysql Server 5.1\bin, cmd goes to the command line
3. Run C:\Program files (x86) \mysql\mysql Server 5.1\bin\mysqld--defaults-file= "C:\Program files (x86) \mysql\mysql Server 5.1\my.ini "--console--skip-grant-tables


4. Open a DOS window again, and cut to the MySQL bin directory,
C:\Program Files (x86) \mysql\mysql Server 5.1\bin\>mysql-uroot MySQL

5. Change root password, mysqladmin-u root flush-privileges password "NewPassword"

6. Restart the MySQL service

MySQL error:access denied for user ' root ' @ ' localhost ' (using Password:yes)

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.