SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema = chobo and table_name = migrations and table_type = 'BASE TABLE')
라라벨7 mysql 8.0이상 연동하였을때 인증 오류 발생!!!
해결방법)
1. mysql 로그인
myslq -uroot -p
2. mysql 데이터베이스에 접근
use mysql;
꼭 myql 데이터베이스에 접근해서 비밀번호를 변경해야 된다. 그렇지 않으면 syntax 에러가 날 것이다.
그럼 이제 mysql의 테이블들을 보자. 대따 많다. 필요한건 user 이다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
mysql> show tables; +---------------------------+ | Tables_in_mysql | +---------------------------+ | columns_priv | | component | | db | | default_roles | | .... | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ 33 rows in set (0.00 sec) |
cs |
3. select * from user 해보면 패스워드가
$A$005$THISISACOMBINA 이딴식으로 되어 있는걸 알 수 있음 그래서 비밀번호로 인증 시도 했을때 실패 하는거임!!!
4. 비밀번호 변경
ALTER user 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '변경할비밀번호';
5. 변경 사항 저장
flush privileges;
1 2 |
mysql> flush privileges; Query OK, 0 rows affected (0.01 sec) |
cs |
그리고 다시 php artisan migrate하면 성공!!!!!!!!!!!!