The user specified as a definer ('root'@'%') does not exist 此种报错主要是针对访问视图文件引发的(没有权限)mysql
按照下图进行操做,sql
1.先看下mysql是否设置了环境变量,若是没设置,就须要切换到mysql的bin目录下执行命令(个人已经设置过了)ide
mysql -hlocalhost -uroot -p123456
2.给root用户添加权限spa
grant all privileges on *.* to root@"%" identified by ".";
3.刷新权限code
flush privileges;