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

The user specified as a definer ('root'@'%') does not exist 此种报错主要是针对访问视图文件引起的(没有权限)

按照下图进行操作,

1.先看下mysql是否设置了环境变量,如果没设置,就需要切换到mysql的bin目录下执行命令(我的已经设置过了)

mysql -hlocalhost -uroot -p123456

2.给root用户添加权限

grant all privileges on *.* to root@"%" identified by ".";

3.刷新权限

flush privileges;
posted @ 2019-07-01 17:00  DarJeely  阅读(365)  评论(0)    收藏  举报