You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/11/18 07:14:10 UTC

[GitHub] [shardingsphere] azexcy opened a new issue, #22255: Migration MySQL incremental task failed when using the newly created user and add the appropriate privilege

azexcy opened a new issue, #22255:
URL: https://github.com/apache/shardingsphere/issues/22255

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Migration MySQL incremental task failed when using the newly created user and add the appropriate privilege.
   
   ```
   [ERROR] 2022-11-18 15:00:16.805 [nioEventLoopGroup-4-1] o.a.s.d.p.m.i.client.MySQLClient - MySQLCommandResponseHandler protocol resolution error
   java.lang.RuntimeException: Access denied for user 'test'@'%' to database 'mysql'
   	at org.apache.shardingsphere.data.pipeline.mysql.ingest.client.netty.MySQLNegotiateHandler.channelRead(MySQLNegotiateHandler.java:112)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
   	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:324)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
   	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
   	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
   	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
   	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
   	at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
   	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
   	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
   	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
   	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
   	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
   	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   	at java.lang.Thread.run(Thread.java:750)
   [ERROR] 2022-11-18 15:00:16.810 [ShardingSphere-pipeline-Incremental-j51017f973ac82cb1edea4f5238a258c25e89-4] o.a.s.d.p.c.t.InventoryIncrementalTasksRunner - onFailure, incremental task execute failed.
   java.util.concurrent.CompletionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Access denied for user 'test'@'%' to database 'mysql'
   	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
   	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
   	at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1643)
   	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:750)
   Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Access denied for user 'test'@'%' to database 'mysql'
   	at org.apache.shardingsphere.data.pipeline.mysql.ingest.client.MySQLClient.waitExpectedResponse(MySQLClient.java:233)
   	at org.apache.shardingsphere.data.pipeline.mysql.ingest.client.MySQLClient.connect(MySQLClient.java:106)
   	at org.apache.shardingsphere.data.pipeline.mysql.ingest.MySQLIncrementalDumper.runBlocking(MySQLIncrementalDumper.java:92)
   	at org.apache.shardingsphere.data.pipeline.api.executor.AbstractLifecycleExecutor.start(AbstractLifecycleExecutor.java:52)
   	at org.apache.shardingsphere.data.pipeline.api.executor.AbstractLifecycleExecutor.run(AbstractLifecycleExecutor.java:90)
   	at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1640)
   	... 4 common frames omitted
   ```
   
   But when using MySQL client. It'ok
   ```
   ➜  ~ mysql -u test -P3306 -h 127.0.0.1 -p
   Enter password:
   Welcome to the MySQL monitor.  Commands end with ; or \g.
   Your MySQL connection id is 834
   Server version: 8.0.27 MySQL Community Server - GPL
   
   Copyright (c) 2000, 2022, Oracle and/or its affiliates.
   
   Oracle is a registered trademark of Oracle Corporation and/or its
   affiliates. Other names may be trademarks of their respective
   owners.
   
   Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
   
   mysql> show grants for test;
   +------------------------------------------------------------------+
   | Grants for test@%                                                |
   +------------------------------------------------------------------+
   | GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO `test`@`%` |
   | GRANT SELECT ON `mysql`.* TO `test`@`%`                          |
   | GRANT ALL PRIVILEGES ON `ds_0`.* TO `test`@`%`                   |
   | GRANT ALL PRIVILEGES ON `ds_1`.* TO `test`@`%`                   |
   +------------------------------------------------------------------+
   4 rows in set (0.01 sec)
   
   mysql> SHOW MASTER STATUS;
   +---------------+-----------+--------------+------------------+-------------------+
   | File          | Position  | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
   +---------------+-----------+--------------+------------------+-------------------+
   | binlog.000006 | 381627201 |              |                  |                   |
   +---------------+-----------+--------------+------------------+-------------------+
   1 row in set (0.00 sec)
   
   mysql>
   ```
   
   
   ### Which version of ShardingSphere did you use?
   
   master 8c9d4b6425b8e73dca66b1893738c33af881b6d2
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   slave connect suceess just like using mysql client.
   
   ### Actual behavior
   
   throw `Access denied for user 'test'@'%' to database 'mysql'`
   
   ### Reason analyze (If you can)
   
   the mysql slave use the default database at connecting.
   <img width="1197" alt="image" src="https://user-images.githubusercontent.com/101622833/202642252-71f841f2-08bd-4c8c-acc4-440b7bba5bef.png">
   
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] sandynz closed issue #22255: Migration MySQL incremental task failed when using the newly created user and add the appropriate privilege

Posted by GitBox <gi...@apache.org>.
sandynz closed issue #22255: Migration MySQL incremental task failed when using the newly created user and add the appropriate privilege
URL: https://github.com/apache/shardingsphere/issues/22255


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org