数据库
首页 > 数据库> > FlinkCDC在生产环境测试时一直报错没有MySQL的RELOAD权限

FlinkCDC在生产环境测试时一直报错没有MySQL的RELOAD权限

作者:互联网

之前测试环境用root没这个问题。换到生产环境指定的某个mysql账号出现权限不足:

Caused by: java.sql.SQLSyntaxErrorException: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:764)
        at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648)
        at io.debezium.jdbc.JdbcConnection.executeWithoutCommitting(JdbcConnection.java:1323)
        at io.debezium.connector.mysql.SnapshotReader.execute(SnapshotReader.java:483)

需要修改:这类权限的授权不是针对某个数据库的,因此须使用on *.*来进行:

grant reload on *.* to 'user_name'@'%';

 

标签:cj,jdbc,java,StatementImpl,RELOAD,报错,FlinkCDC,mysql,com
来源: https://www.cnblogs.com/30go/p/15808632.html