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'@'%';

 

上一篇:Django讲课笔记10:使用QuerySet删除和查询单表


下一篇:JSHint