mysql报错:The user specified as a definer ('skip-grants user'@'skip-grants host') does not exist

起因是:我从另一台电脑将数据库导出成sql文件,然后在本电脑运行sql文件,结构和数据没有问题,但是要插入数据的时候报The user specified as a definer ('skip-grants user'@'skip-grants host') does not exist 的错误


找了一些文档,发现是权限问题,创建那些数据所用的用户在本电脑上不存在,所以这边的用户没有权限操作数据库


解决办法是给用户添加权限


新建查询,执行以下语句


grant all privileges on *.* to 'skip-grants user'@'skip-grants host' identified by "."

框框里面的对应就行了 



————————————————

版权声明:本文为CSDN博主「wusq5477」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/qq_42345108/article/details/103950857