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

今天在项目中写junit测试更新mysql表数据的时候,运行测试的时报了The user specified as a definer ('test01'@'%') does not exist,

数据不能成功插入,用root用户连接的数据库,后来到数据库去看的时候发现update触发器写的是 /*!50017 DEFINER = 'test01'@'%' */,

把test01改为了root后junit可以正确执行了。definer 定义了trigger中sql语句在执行时候的权限,test01没有这个执行权限导致的。

在网上搜了一下,很多人都说给用户赋予权限就可以了

解决方法:

用root登录mysq

执行

mysql >grant all privileges on *.* to root@"%" identified by "Passwd" ; 
 
mysql >flush privileges;

原文:https://blog.csdn.net/lijunlinlijunlin/article/details/44841595

猜你喜欢

转载自blog.csdn.net/u011974797/article/details/79915586