Tag Archives: Forget the password

MYSQL Error 1045 (28000): access denied for user ‘root’ @’localhost ‘(using password: Yes)

Error 1045 (28000): access denied for user ‘root’ @’localhost ‘(using password: Yes)

This prompt is a password error. If you forget your password, you can use this method to reset your password
* * 1. * * the first step to reset your password is to skip the password authentication process of MySQL
modify the MySQL configuration file
and find it in the directory of C:// program files/MySQL/MySQL server 5.7 my.cnf/my .ini/my- default.ini One of the three is modified
in [mysqld] skip-grant-tables

**2 * * restart MySQL service

	net start mysql

If this command reports an error and cannot start MySQL service, run it as an administrator cmd.exe ( cmd.exe In the directory of C: Windows: system32

**3. * * implementation again

	mysql -u root -p

You don’t need to enter a password. Press enter to enter mysql

**4 * * Change Password

	update user set Password=PASSWORD('888888') where User='root'; 
	FLUSH PRIVILEGES;

Use 888888 to login next time

5. If 4 reports error 1820 (HY000): you must set password before executing this statement, execute the code

 	SET PASSWORD = PASSWORD('123456');
	or SET PASSWORD = '123456';

Then prompt query OK, 0 rows affected (0.00 sec)
and you can log in with 123456 password