본문 바로가기

Backend/DB

[MYSQL] grant all on *.* to 'root'@'%' identified by 'password' with grant option; 실행 시 ERROR 1064 (42000) 오류 해결

문제

uncategorized SQLException for SQL []; SQL state [HY000]; error code [1449]; The user specified as a definer ('orbit'@'%') does not exist; nested exception is java.sql.SQLException: The user specified as a definer ('orbit'@'%') does not exist

오류 발생~!!!

 

문제 해결 시도

grant all on *.* to 'root'@'%' identified by 'password' with grant option;  

 

참고) https://m.blog.naver.com/PostView.nhn?blogId=kkson50&logNo=120172066954&proxyReferer=https:%2F%2Fwww.google.com%2F

 

다른 문제 발생

Starting with MySQL 8 you no longer can (implicitly) create a user using the GRANT command. Use CREATE USER instead, followed by the GRANT statement:mysql> CREATE USER 'orbit'@'%' IDENTIFIED BY 'orbit';

해결

Starting with MySQL 8 you no longer can (implicitly) create a user using the GRANT command. Use CREATE USER instead, followed by the GRANT statement:

mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'root';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;

참고) https://stackoverflow.com/questions/50177216/how-to-grant-all-privileges-to-root-user-in-mysql-8-0