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。

  • 相关阅读:
    自动化基础知识
    第一章Google软件测试介绍
    《将博客搬至CSDN》
    二叉树的先序遍历和中序遍历分析(递归)
    java 部分快捷功能
    toString
    自增自减运算符剖析
    二进制数的直接表示
    编程中的&&和||
    npm 镜像地址设置
  • 原文地址:https://www.cnblogs.com/xh_Blog/p/15569193.html
Copyright © 2011-2022 走看看