The user specified as a definer ('root'@'%') does not exist

缘由分析
由于建立视图使用的是root@%用户(目前已经不存在),而后登陆用户使用的是test@localhost用户,致使mysql认为如今的test用户无权限访问该视图,解决方法就是在当前用户下test 重建该视图。
若是你是运维人员,此问题直接交由程序去处理,让其检查建立触发器、视图、存储过程等sql。若是包含root@%,替换之。从新建立。
 
结合一下命令,能够看个大概。
select `name` from mysql.proc where db = 'xxxxxx' and `type` = 'PROCEDURE' limit  5\G
update mysql.event set definer='admin@%' where db='xxxxx‘;
show events\G
show procedure status; 
update mysql.proc  set  definer='admin@%'  where db = 'xxxxxxxx' and `type` = 'PROCEDURE';
select * from  information_schema.VIEWS limit 4\G
show triggers\G
show function status\G