728x90
반응형
MySQL에서 테스트 계정을 생성하려고 했는데 다음과 같은 에러가 나왔습니다.
mysql> GRANT ALL PRIVILEGES ON *.* to 'test'@'localhost' IDENTIFIED BY 'test123';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'test123'' at line 1
알아보니까 MySQL version 5.7.6. 버전 이후 부터는 GRANT 문과 함께 IDENTIFIED BY 로 계정 생성/ 암호 설정이 사용되지 않습니다.
해결방법
1) 유저 생성
mysql> CREATE USER 'test'@'localhost' IDENTIFIED BY 'test123';
Query OK, 0 rows affected (0.12 sec)
2) 권한 부여
mysql> GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost';
Query OK, 0 rows affected (0.03 sec)
마지막으로 IDENTIFIED BY '암호'를 사용하는 GRANT는 더 이상 사용되지 않으며 CREATE USER 또는 ALTER USER를 사용하여 사용자 계정을 생성 후 권한을 설정해 줘야합니다.
<참고>
https://techglimpse.com/error-grant-identified-by-password/
Error using GRANT with IDENTIFIED by password in MySQL - Techglimpse
GRANT with IDENTIFIED by password fails in MySQL? Well, the feature is now deprecated for good reasons and here's an alternate method.
techglimpse.com
728x90
반응형
'일지' 카테고리의 다른 글
[Mysql] Access denied for user 해결 / 계정 비밀번호 확인하기 (0) | 2023.07.24 |
---|---|
[Linux] rsync pem키로 인증하기 (0) | 2023.07.24 |
[보안] 리눅스 서버 패스워드 복잡성 설정하기 (0) | 2023.06.30 |
[Spring] 생성자 주입 : @Autowired(필드 주입) 대신 생성자 주입 권장 이유 (0) | 2023.06.16 |
[Windows] hosts 파일 수정하기 (0) | 2023.06.15 |
댓글