마리아db 사용자 권한 생성 및 조회
마리아db 계정확인
show databases;
use mysql;
select host,user,password from user;
===============================================
여기서 주의할 점은 use mysql; 해서 mysql db로 간 다음에 select .. 를 해야 한다는 것이다.
그런데 이상한것이 있었다. 분명 구글링 한대로
grant all privileges on 'ssss'.* to 'ssss'@'%';
했는데 자꾸
ERROR 1064 (4200): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''ssss'.* TO 'ssss'@'%'' at line 1
이렇게 나오는 것이였다.
이상하네..
그래서 기존에 있는것을 조회해보니
grant all privileges on `ssss`.* to `ssss`@`%`;
'가 아니도 ` 였다.
그래서 '을 `로 바꾸고 했더니
정상적으로
Qeury OK, 0 rows affected (0.003 sec)
이렇게 나오는 것이였다.
show grants for 'ssss'@'%';
해보니
grant all privileges on `ssss`.* to `ssss`@`%`;
이렇게 1줄이 추가 되었다. 즉, 정상적으로 됬다는 것이다.
아놔.. '게 아니도 `라니...
https://yamyam-spaghetti.tistory.com/68
mysql, mariaDb 계정 생성 및 권한 부여
mysql, mariaDB에 모두 동일하게 동작하는 명령어 입니다. 왜 동일하게 동작할까? 계정 생성create user '[userid]'@'[host]' identified by '[password]';userid에는 사용하고자 하는 계정의 id를 적어주면 된다.host는 d
yamyam-spaghetti.tistory.com