zoukankan      html  css  js  c++  java
  • java 执行mysql 8.0.11存储过程报错The user specified as a definer ('root'@'10.%.%.%') does not exist解决办法

    执行存储过程,报错

     

    java.sql.SQLException: The user specified as a definer ('root'@'10.%.%.%') does not exist

    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127)

    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)

    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)

    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:960)

    at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:388)

    at com.mysql.cj.jdbc.CallableStatement.execute(CallableStatement.java:809)

    at com.paxunke.smart.utils.MysqlUtils.execWriteReportProc(MysqlUtils.java:260)

    at com.paxunke.smart.testcase.Test.main(Test.java:125)

     

     执行 grant all privileges on *.* to root@"%" identified by "." 也报错

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

    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by "."' at line 1

     

     

    最终解决办法:

    执行sql语句:

      GRANT ALL PRIVILEGES ON database_name.* to 'root'@'localhost';

      FLUSH   PRIVILEGES; 

     

    存储过程中 definer修改为:root@localhost

      

     

     

  • 相关阅读:
    在上传文件时限制上传文件的大小,并捕捉超过文件大小限制的
    javascript 获取标签具体位置
    终端服务器超出了最大允许连接数
    常用SQL语句书写技巧
    Javascript实现截图功能(代码)
    JavaScript实现类,有多种方法。
    DBCC CHECKDB 数据库或表修复
    Lucene的例子
    控制同一exe程序打开多次
    IIS6 MMC检测到此管理单元发生一个错误,建议您关闭并重新启动mmc
  • 原文地址:https://www.cnblogs.com/testway/p/9018893.html
Copyright © 2011-2022 走看看