MySQL에 이미 있는 root 계정의 권한을 localhost 에서 %로 바꾸려는데 에러 발생
MySql 8.0 이후부터는
계정 생성과 권한 부여를 한 번에 할 수 없다
에러 메세지
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
과거에는 아래와 같이 생성 과 권한 부여를 동시에 했다.
mysql> grant all privileges on DB이름.* to 계정ID@'%' identified by '비밀번호';
mysql> flush privileges;
mysql> create user 계정ID@'%' identified by '비밀번호';
mysql> grant all privileges on DB이름.* to 계정ID@'%';
mysql> flush privileges;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)