rodrigogs / mysql-events

A node package that watches a MySQL database and runs callbacks on matched events.
BSD 3-Clause "New" or "Revised" License
137 stars 53 forks source link

ER_SPECIFIC_ACCESS_DENIED_ERROR but does have all the privileges needed #22

Open marileen-jansen opened 5 years ago

marileen-jansen commented 5 years ago

My user definitely has the REPLICATION CLIENT privilege (as well as REPLICATION SLAVE) but I still get the error below. I have even tried the script with the SUPER privilege. When I read the binlog with only using ZongJi I get no errors and can read the binlog.

code: 'ER_SPECIFIC_ACCESS_DENIED_ERROR',
  errno: 1227,
  sqlMessage:
   'Access denied; you need (at least one of) the SUPER, REPLICATION CLIENT privilege(s) for this operation',
  sqlState: '42000',
  index: 0,
  sql: 'SHOW BINARY LOGS'
rodrigogs commented 5 years ago

This is very strange, what MySQL version are you using?

just-nilux commented 5 years ago

@rodrigogs got the same issue. Permission should be alright, I've granted REPLICATION status on the user and check ed the mysql-bin settings.

code: 'ER_SPECIFIC_ACCESS_DENIED_ERROR', errno: 1227, sqlMessage: 'Access denied; you need (at least one of) the REPLICATION SLAVE privilege(s) for this operation', sqlState: '42000' }

MySQL Server version: 5.7.27-0ubuntu0.18.04.1-log

marileen-jansen commented 5 years ago

This is very strange, what MySQL version are you using?

@rodrigogs Hi, I'm using Version: 5.5.60-MariaDB on Linux (x86_64)

JesusMtx commented 5 years ago

Hi, i got the same issue.

code: 'ER_SPECIFIC_ACCESS_DENIED_ERROR', errno: 1227, sqlMessage: 'Access denied; you need (at least one of) the REPLICATION SLAVE privilege(s) for this operation', sqlState: '42000' }

Granted all privileges to the users

Variable_name Value  
innodb_version 5.6.42-84.2
protocol_version 10
slave_type_conversions  
version 10.1.38-MariaDB
version_comment Source distribution
version_compile_machine x86_64
version_compile_os osx10.10
version_malloc_library system
version_ssl_library OpenSSL 1.0.2q  20 Nov 2018
wsrep_patch_version wsrep_25.24
rodrigogs commented 5 years ago

I'm not sure how I can reproduce the error. The tests are passing with MySQL 5.5, 5.6, 5.7 and 8.0.

JesusMtx commented 5 years ago

I'm not sure how I can reproduce the error. The tests are passing with MySQL 5.5, 5.6, 5.7 and 8.0.

In my case, it was a port redirection problem and user permissions in MySQL.

Captura de Pantalla 2019-11-04 a la(s) 10 17 18

I had to create a new user (dev) with the server name equal to my local ip since I use a XAMPP VM (Virtual Machine). Apparently the same error is reproduced by having the same username with different server names (in my case the root user). Greetings and I apologize for my English

kevindude commented 5 years ago

I ran into the same issue. it works fine on another server(CentOS) with same node version(v8.12.0) connect to the same mysql database with version 5.6. but it gives the following error run on an ubuntu server.

[2019-11-20 11:30:52.932] [INFO] console - Waiting for database events... [2019-11-20 11:30:52.941] [INFO] console - ZongJi error { Error: ER_SPECIFIC_ACCESS_DENIED_ERROR: Access denied; you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation at Query.Sequence._packetToError (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14) at Query.ErrorPacket (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/sequences/Query.js:77:18) at Protocol._parsePacket (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/Protocol.js:278:23) at Parser.write (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/Parser.js:76:12) at Protocol.write (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/Protocol.js:38:16) at Socket. (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/Connection.js:91:28) at Socket. (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/Connection.js:502:10) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at Socket.Readable.push (_stream_readable.js:208:10) at TCP.onread (net.js:601:20)

at Protocol._enqueue (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Connection.query (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/Connection.js:200:25)
at ZongJi._findBinlogEnd (/alidata/web/yry-bops/node_modules/@rodrigogs/zongji/index.js:169:23)
at nextMethod (/alidata/web/yry-bops/node_modules/@rodrigogs/zongji/index.js:98:22)
at /alidata/web/yry-bops/node_modules/@rodrigogs/zongji/index.js:102:9
at Query.<anonymous> (/alidata/web/yry-bops/node_modules/@rodrigogs/zongji/index.js:138:16)
at Query.<anonymous> (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/Connection.js:502:10)
at Query._callback (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/Connection.js:468:16)
at Query.Sequence.end (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query.ErrorPacket (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/sequences/Query.js:90:8)
at Protocol._parsePacket (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket.<anonymous> (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/Connection.js:91:28)
at Socket.<anonymous> (/alidata/web/yry-bops/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:116:13)

code: 'ER_SPECIFIC_ACCESS_DENIED_ERROR', errno: 1227, sqlMessage: 'Access denied; you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation', sqlState: '42000', index: 0, sql: 'SHOW BINARY LOGS' }

zero2603 commented 4 years ago

I think your connection config is wrong. You can try console.log(connection) to see its infomation. Same issue for me and I resolved it by checked connection config.