개발/DB(Oracle, MySQL)

mysql root 비밀번호 잊어버렸을 때 하필 접근 오류까지 뜬다....1045

쵸코푸들이장군 2018. 7. 30. 17:18

mysql -u root -p

Enter password:

ERROR 1045(28000):Access denied for user '**'@'localhost' (using password:YES)


위와 같이 접근 오류가 뜰때, 하필 비번도 모르겠을 때 하는 방법.

service mysql stop

mysqld_safe --skip-grant-tables &

mysql -u root -p

비밀번호 없이 엔터를 친다.

접속이 된다.


use mysql;

데이터베이스가 바뀐다.

update user set authentication_string=password('asdqwe123') where user='root';

flush privileges;



이러면 되네..ㅠ