til
til copied to clipboard
The user specified as a definer ('userid'@'%') does not exist
데이터베이스를 이쪽에서 저쪽으로 복사했더니 발생하는 이슈. 뷰를 생성한 DEFINER 가 데이터베이스에 존재하지 않아서 발생한다.
뷰의 DEFINER 를 수정하는 방법이 있다.
https://stackoverflow.com/questions/10169960/mysql-error-1449-the-user-specified-as-a-definer-does-not-exist
나는 그냥 뷰의 Create 쿼리를 확인한 다음, 삭제하고 다시 만들었다.
MySQL 8.0을 사용할 경우 root 사용자를 추가해야한다.
https://stackoverflow.com/questions/50177216/how-to-grant-all-privileges-to-root-user-in-mysql-8-0
Starting with MySQL 8 you no longer can (implicitly) create a user using the GRANT command. Use [CREATE USER](https://dev.mysql.com/doc/refman/8.0/en/create-user.html) instead, followed by the [GRANT](https://dev.mysql.com/doc/refman/8.0/en/grant.html) statement:
mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'PASSWORD';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;