mysql:1045 access denied for user ' root ' @ ' localhost ' using password Yes

Source: Internet
Author: User

The reason: root password is wrong.

Workaround: Turn off the MySQL service, restart the MySQL service, and when you start MySQL, specify that you do not need to verify the password. Then log in to MySQL, change the password, and exit. Then restart the MySQL service.

1. Turn off MySQL

2. Start MySQL, specify no need to verify password

C:\Program files\mysql\mysql Server 5.1\bin>mysqld--defaults-file= "C:\Program
Files\mysql\mysql Server 5.1\my.ini "--console--skip-grant-tables

3. Open a window, root login, change password

C:\Program files\mysql\mysql Server 5.1\bin>mysql-uroot mysql (explanation:-uroot mysql behind this mysql refers to the connection to the MySQL library, because skipping permission validation, so You can log in to MySQL without a password)
Mysql>

MySQL>UPDATEuserSET Password=Password ('newpassword  'whereUSER='root'; MySQL > Privileges ; MySQL >

4. Restart MySQL again

mysql:1045 access denied for user ' root ' @ ' localhost ' using password Yes

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.