数据库报错The user specified as a definer ('root'@'%') does not exist 解决方法
2017-09-26 17:18
495 查看
原因:
The user specified as a definer (‘root’@’%’) does not exist 此种报错主要是针对访问视图文件引起的(没有权限)解决方法:
进入mysql的安装路径之前,要确保你的mysql服务是开启的;1.在DOS命令窗口输入 mysql -hlocalhost -uroot -p密码 回车
mysql -hlocalhost -uroot -p
解析:
在DOS命令窗口输入 mysql -hlocalhost -uroot -p回车 进入mysql数据库,
其中-h表示服务器名,localhost表示本地;
-u为数据库用户名,root是mysql默认用户名;
-p为密码,如果设置了密码,可直接在-p后链接输入,如:-p123456,用户没有设置密码,显示Enter password时,直接回车即可。
注意,如果你的mysql没有安装在C盘下,你需要先使用DOS命令进入mysql的安装目录下的bin目录中。
方法如下:输入D:进入D盘,在输入cd D:\Program Files (x86)\MySQL\MySQL Server 5.7\bin 进入到mysql的bin目录下才可以输入 mysql -hlocalhost -uroot -pc
2.给mysql添加权限dsd ——权限问题,授权 给 root 所有sql 权限
mysql> grant all privileges on *.* to root@"%" identified by "."; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
相关文章推荐
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- PHP 开发遇到数据库 The user sepcified as a definer ('root'@'%') does not exist 错误 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- The user specified as a definer ('root'@'%') does not exist解决方法
- 心得体会 mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mySql问题:The user specified as a definer ('root'@'%') does not exist 解决方法
- java.sql.SQLException: The user specified as a definer ('root'@'%') does not exist 解决方法
- The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法