BASHA TECH

localhost 권한 부여 되지 않는 문제 본문

Error

localhost 권한 부여 되지 않는 문제

Basha 2022. 11. 18. 15:09
728x90

grant all privileges on data_anal.*  to 'hong'@'localhost';  를 쳤을 때,

error 1133 can't find any matching row in the user table 이게 뜬다.

사용자 생성 후에 flush privileges; 했는데도 안됨.

select host, user from user; 명령어를 통해 권한을 확인 하면.

hong에겐 권한이 없는 것이 확인 된다.

그래서 hong에게도 localhost를 생성하기로 했다.

MariaDB [mysql]> create user hong@'localhost' identified by '1234';
Query OK, 0 rows affected (0.00 sec)

select host, user from user; 다시 쳐보면... hong도 localhost가 생겼음.

다시 한번 hong에게 data_anal db의 localhost권한을 줘보자.

grant all privileges on data_anal.*  to 'hong'@'localhost';

MariaDB [mysql]> grant all privileges on data_anal.* to hong@'localhost';
Query OK, 0 rows affected (0.00 sec)

아주 깔끔하게 생성 완료 된 것을 볼 수 있다.

 

인터넷을 뒤졌을 때  flush privileges; 이걸 하고 저 명령어를 치면 거의 되는 것 같았고...

내 해결법은.. hong에게도 localhost 권한을 부여하고 해당 db localhost 권한까지 부여하니 되었다.

 

깔끔 해결~

 

728x90
반응형
Comments