The key is to see: Access denied for user ' root ' @ ' localhost ' (using Password:yes) '
From the error you can see that your permission is not open to the localhost access.
You can then use the following command to release permissions:
Solutions
1. Admin login system, stop MySQL service or end mysqld-nt process;
2. Go to the command line and come to MySQL's installation directory. Suppose the installation directory is d:mysql, cmd enter the command line;
3. Run D:program filesmysqlmysql Server 5.5binmysqld-nt--skip-grant-tables start MySQL, turn off the check of permissions;
4. Run D:program filesmysqlmysql Server 5.5binmysqladmin-u root flush-privileges password "newpassword" to reset the root password;
5. Restart the MySQL service;
The way the order is resolved
Method One:
The code is as follows |
Copy Code |
#/data/mysql/bin/mysqladmin-u-P < First stop MySQL before you start. And if it stops. There are also 1045 errors that only kill the MySQL pid> # Mysqld_safe--user=mysql--skip-grant-tables--skip-networking & # mysql-u Root MySQL mysql> UPDATE user SET Password=password (' NewPassword ') where user= ' root '; mysql> FLUSH privileges; Mysql> quit #/etc/init.d/mysql Restart # mysql-uroot-p Enter Password: < Enter the new password newpassword> Mysql> |
Workaround Two
First, the client command line to MySQL is counted.
And then
The code is as follows |
Copy Code |
Grant all privileges in *.* to ' root ' @ ' localhost ' identified by ' your password ' with GRANT option; Flush privileges; |
That's all you have to do when you're done with these two commands.