zoukankan      html  css  js  c++  java
  • mysql8.0版本 the user specified as a definer ('root'@'%') does not exist问题解决

    叙述(可忽略,直接看下面的解决方法)

    在修改数据库数据时,遇到the user specified as a definer ('root'@'%') does not exist错误

    利用网上给的方法

    grant all privileges on *.* to root@"%" identified by "Passwd"

    提示语法错误

    原因是mysql8.0 grant授权后面不用带identified by...

    重新输入

    grant all privileges on *.* to 'root'@'%';

    再次报错

    查询资料后,发现是版本的问题,8.0.11版本之后移除了grant 语句添加用户的功能,也就是说grant...只能适用于已存在的账户,不能通过 grant... 来添加账号了。

    解决方法

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

    本地处理

    create user 'root'@'%' identified by '1234';
    
    grant all privileges on *.* to 'root'@'%';
    
    flush privileges;

    end。

  • 相关阅读:
    C++ 类
    百练3383:Cell Phone Network
    百练4092:牛仔裤
    百练4091:最近餐馆
    百练4090:超级备忘录
    百练2868:牛顿迭代
    百练2812:恼人的青蛙
    百练2805:正方形
    bzoj1856 [Scoi2010]字符串
    bzoj2096 [Poi2010]Pilots
  • 原文地址:https://www.cnblogs.com/xh_Blog/p/15569193.html
Copyright © 2011-2022 走看看