MySQL - ERROR 1064 (42000)

Stella·2022년 5월 6일
0

Error

목록 보기
2/2

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 'connect123!@#'' at line 1

MySQL8 부터는 grant로 user 생성이 불가능.

해결 방법

CREATE USER 'connectuser'@'%' IDENTIFIED BY 'connect123!@#';
GRANT ALL PRIVILEGES ON *.* TO 'connectuser'@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON connectdb.* to 'connectuser'@'%' WITH GRANT OPTION;
flush privileges;

생성한 database에 접속 (cmd창을 열고 실행).
mysql -h호스트명 -uDB계정명 -p데이터베이스이름
db 이름이 connectdb, db계정이 connectuser, 암호가 connect123!@# 일 경우

mysql -h127.0.0.1 -uconnectuser -p connectdb

연결 끊기

quit;
profile
Hello!

0개의 댓글