MYSQL 1045 - Access denied for user ‘root‘@‘localhost‘ (using password: YES)

MYSQL 1045 - Access denied for user ‘root’@‘localhost’ (using password: YES)

insert image description here

1. Stop mysql service

cmd open terminal

net stop mysql 

2. Skip inspection

mysqld --shared-memory --skip-grant-tables

3. Connect to mysql

Also open another terminal

mysql -uroot -p

insert image description here
switch to mysql

use mysql

insert image description here

4. Set/update password

Refresh permissions

flush privileges ;

insert image description here
set password

alter user 'root'@'localhost' identified by '123456'; 

insert image description here
Refresh permissions again

flush privileges ;

5. Reconnect to local mysql

mysql -uroot -p 

Or pass the navicat connection test.
insert image description here

Guess you like

Origin blog.csdn.net/weixin_44167504/article/details/127385001