原文链接https://www.cnblogs.com/zejin2008/p/4767531.html
修改view的definer
相比function的修改麻烦点:
select DEFINER from information_schema.VIEWS;
select concat("alter DEFINER=`user`@`localhost` SQL SECURITY DEFINER VIEW ",TABLE_SCHEMA,".",TABLE_NAME," as ",VIEW_DEFINITION,";") from information_schema.VIEWS where DEFINER<>'user@localhost';
查询出来的语句再执行一遍就好了。
记得把查询出来的语句 `user` 用户改为你自己访问数据库用户,譬如:root