The user specified as a definer (”@’%') does not exist 解决办法

第一种:

给root赋值所有权限:注意在命令符下面操作。
grant all privileges on *.* to [email protected]”%” identified by “.”;
flush privileges;
但是这种重启之后一会就又不行了。

第二种:
复制视图创建语句,直接将create改成alter,definer改成相关的,比如[email protected]  例如:
用alter view 修改definer的值,alter ALGORITHM=UNDEFINED DEFINER=`public`@`192.168.0.%` SQL SECURITY DEFINER VIEW `view_product` AS 视图选择语句。

通过执行use information_schema;和 select TABLE_SCHEMA,TABLE_NAME,DEFINER from views; 两条语句,可以查询到definer是否更改成功了。

原因分析
因为创建视图使用的是[email protected]%用户(目前已经不存在),然后登录用户使用的是[email protected]用户,导致mysql认为现在的用户无权限访问该视图,解决方法就是在当前用户下重建该视图。

题外话:还有一种方法是如果你是运维人员,此问题直接交由程序去处理,让其检查创建触发器、视图、存储过程等sql。如果包含[email protected]%,替换之。重新创建。没有尝试过,后面可以试试。

The user specified as a definer (”@’%') does not exist 解决办法

时间: 2024-10-07 11:52:51

The user specified as a definer (”@’%') does not exist 解决办法的相关文章

mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法

程序在调用到数据库的视图时报错,直接在数据库中打开视图时也报错,类似: mysql 1449 : The user specified as a definer ('montor'@'%') does not exist 经查,是权限问题,解决办法: 运行:grant all privileges on *.* to [email protected]"%" identified by "."; 之后打开视图时便不会报错,程序调用也不会报错. 源地址的解释: 权限问

mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法

权限问题,授权 给 root  全部sql 权限 mysql> grant all privileges on *.* to [email protected]"%" 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 speci

mysql1449 The user specified as a definer ('root'@'%') does not exist 解决方法

从一个数据库数据迁移到本地localhost 程序在调用到数据库的视图时报错,直接在数据库中打开视图时也报错,类似: mysql 1449 : The user specified as a definer ('long'@'%') does not exist 经查,是权限问题,解决办法: 运行:grant all privileges on *.* to [email protected]"%" identified by "."; 之后打开视图时便不会报错,程

mysql 数据库数据迁移 The user specified as a definer ('root'@'%') does not exist 解决方法

从一个数据库数据迁移到本地localhost 程序在调用到数据库的视图时报错,直接在数据库中打开视图时也报错,类似: mysql 1449 : The user specified as a definer ('montor'@'%') does not exist 经查,是权限问题,解决办法: 运行:grant all privileges on *.* to [email protected]"%" identified by "."; 之后打开视图时便不会报错

Caused by: java.sql.SQLException: The user specified as a definer (''@'') does not exist

mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法权限问题,授权 给 root 所有sql 权限 mysql> grant all privileges on *.* to [email protected]"%" identified by ".";Query OK, 0 rows affected (0.00 sec) mysql> flush p

The use specified as definer('root'@'%') does not exist的解决办法

两个表(员工表和部门表)中都有数据,但是点击视图查看数据的时候反而遇见这个问题,于是查询了一下资料解决办法如下: mysql> grant all privileges on *.* to [email protected]"%" identified by ".";Query OK, 0 rows affected (0.00 sec) mysql> flush privileges;Query OK, 0 rows affected (0.00 se

mysql的The user specified as a definer (”@’%') does not exist 的解决办法

两种可能: 1.用户权限不够 赋给用户所有权限试试 mysql> grant all privileges on *.* to [email protected]"%" identified by "."; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) 2.有可能这个视图或者函数的创建人不是当前的用户.一

Java调用存储过程时报 The user specified as a definer ('root'@'%') does not exist 解决方法

Caused by: java.sql.SQLException: The user specified as a definer (''@'') does not exist        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)        at com.mysql

mysql的“The user specified as a definer (”@’%') does not exist”问题 解决

2017-12-27,MYSQL的存储调用时出现了"The user specified as a definer ("[email protected]'%') does not exist"的问题. 网上查过后,都是提示用户权限不够,如:http://blog.handone.com/index.php/archives/137. 但我们生产环境用户都是ROOT,应该不存在用户权限问题.后来无意中发现,存储的定义者是"[email protected]%&quo