본 포스트는 mysql 5.7.34 버전을 기준으로 작성하였습니다.
mysql -uroot -p
use mysql;
그 상태에서 show tables;
를 해보면 user라는 테이블을 확인할 수 있다.
desc user;
로 user table의 필드를 보면
authentication_string
라는 필드가 있는 걸 볼 수 있다. 5.7버전대에서는 이 필드가 비밀번호 필드이므로 이 필드를 바꿔야 한다고 한다.
alter user 계정@'%' identified with mysql_native_password by '바꿀비밀번호';
또는
alter user 계정@'localhost' identified with mysql_native_password by '바꿀비밀번호';
flush privileges;