MySQL login error 1045 solution -1045-Access denied for user 'root'@''(using password: YES)

The reason for this error is that there is no permission to open
insert image description here

Solution:
1. Open the cmd command panel
2. Enter mysql -u root -p, and then enter the password (the password of the database root account)
3. Open the authority

open all

GRANT ALL PRIVILEGES ON . TO ‘root’@‘%’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;

Specify ip to open

GRANT ALL PRIVILEGES ON . TO ‘root’@‘192.168.12.1’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;

4. Refresh permissions flush privileges;
5. Restart MySQL net stop mysql,net start mysql
insert image description here

Guess you like

Origin blog.csdn.net/lhkuxia/article/details/128774797