1449-The user specified as a definer('root'@'localhost') does not exit

1449-The user specified as a definer(‘root’@‘localhost’) does not exitjava

当你安装好了数据库,内心一阵舒爽的时候,而后你怀着激动的心情,安装navicat for mysql 。
安装~~~~
完成~~~~
打开~~~~
创建链接~~~~mysql

突然你忽然发现了下面的状况web

1449-The user specified as a definer(‘root’@‘localhost’) does not exitsql

????数据库

此刻的心中仿佛出现了一万个***;ide

我当时马上就百度了不少的博客,但是和个人错误,有点像,按他们的方法来以后,却又解决不了。svg

以后我发现了,他们都有一个共同点,那就是指向了一个
那就是spa

权限问题

怎么解决权限问题呢,

当你看到其余人的博客去解决这个问题的时候,code

发现按他们的方法去作了,却依旧没有成功,xml

那这个缘由呢就是版本的问题了

8.0.11版本以后移除了grant 语句添加用户的功能

因此呢按照下面的方法去作就能够啦

注意:
下面的root %
均要改为你报错的时候提示的
怎么理解呢
1449-The user specified as a definer(‘root’@‘localhost’) does not exit
个人报错是这个
我就改为了
mysql> create user ‘root’@‘localhost’ identified by ‘密码’;

mysql> create user 'root'@'%' identified by '密码';
    Query OK, 0 rows affected (2.00 sec)
     
    mysql> grant all privileges on *.* to 'root'@'%';
    Query OK, 0 rows affected (0.21 sec)
     
    mysql> flush privileges;
    Query OK, 0 rows affected (0.22 sec)

但愿对你有所帮助,有帮助的话。就点个赞👍吧。