Open dongzl opened 2 years ago
这个需要检查一下,后端数据库连接是否有权限连上呢
这个需要检查一下,后端数据库连接是否有权限连上呢
你好,感谢回复,后端数据库没有问题,可以直接连接,我这里只有一个库,不分库只分表,不知道上面的配置是否有问题?
换个有主从配置的数据库
可能是mysql连接数不够造成的,增加max_connections
我也遇到这个问题了,请问这个问题解决了吗
我也遇到这个问题,日志显示: [2023-06-03 21:15:15] [gaea_proxy] [Julian-M1-Pro.local] [WARN] [900000001] [github.com/XiaoMi/Gaea/proxy/server.(Session).Handshake:session.go:138] handleHandshakeResponse error, connId: 10005, err: ERROR 1045 (28000): Access denied for user 'admin'@'127.0.0.1:62258' (using password: Yes) [2023-06-03 21:15:15] [gaea_proxy] [Julian-M1-Pro.local] [WARN] [900000001] [github.com/XiaoMi/Gaea/proxy/server.(Server).onConn:server.go:128] [server] onConn error: ERROR 1045 (28000): Access denied for user 'admin'@'127.0.0.1:62258' (using password: Yes) [2023-06-03 21:17:20] [gaea_proxy] [Julian-M1-Pro.local] [WARN] [900000001] [github.com/XiaoMi/Gaea/backend.(Slice).GetConn:slice.go:84] get connection from slave failed, try to get from master, error: dc connection handshake failed with mysql [2023-06-03 21:17:20] [gaea_proxy] [Julian-M1-Pro.local] [WARN] [900000001] [github.com/XiaoMi/Gaea/backend.(Slice).GetConn:slice.go:92] get connection from backend failed, error: dc connection handshake failed with mysql [2023-06-03 21:17:20] [gaea_proxy] [Julian-M1-Pro.local] [WARN] [900000001] [github.com/XiaoMi/Gaea/proxy/server.(SessionExecutor).ExecuteSQL:executor.go:796] getUnShardConns failed: dc connection handshake failed with mysql [2023-06-03 21:17:20] [gaea_proxy] [Julian-M1-Pro.local] [WARN] [900000001] [github.com/XiaoMi/Gaea/proxy/server.(SessionExecutor).doQuery:executor_handle.go:107] execute select: dc connection handshake failed with mysql [2023-06-03 21:17:20] [gaea_proxy] [Julian-M1-Pro.local] [WARN] [900000001] [github.com/XiaoMi/Gaea/proxy/server.(*Manager).RecordSessionSQLMetrics:manager.go:333] session error SQL, namespace: test_namespace_1, sql: select @@version_comment limit 1, cost: 33 ms, err: dc connection handshake failed with mysql 这里'admin'@'127.0.0.1:62258'是个啥?也没有用admin用户呀。
有同样的问题,我有两个namespace,一个后端数据库是5.6,另一个是5.7,都是单个服务没有主从,通过代理访问的时候5.6的报错了,writeHandshakeResponse41()执行完之后收到后端的响应头代码是ErrHeader(255),报错同1楼 后端5.7版本的数据库无任何问题,怀疑是版本兼容问题,本人golang不熟对MySQL协议研究也不深,楼主可以参考升级数据库,希望开发者能验证并确认下是否是版本兼容的问题
抓包看了下然后去查了下,网上说应该是版本兼容问题,但是不用代理可以直连,估计是代理的版本支持问题,不确定,希望有大佬指教 MySQL server 版本5.6.50
我这边是8.0.22
版本。打了断点看了下,MySQL
报错Client does not support authentication protocol requested by server; consider upgrading MySQL client
。
因为MySQL8.0
之后,PLUGIN_AUTH
默认是caching_sha2_password
。
我把PLUGIN_AUTH
改成mysql_native_password
就能正常访问了。
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
我也遇到了这个问题。但是应用接入后,只是偶尔报这种错,并不是直接拦截。看上面说是版本问题,那我这种零星报这种错误是什么原因呢?
本地启动 Gaea OK,启动后使用 mycli 连接报如下错误:
(1105, 'unknown error: dc connection handshake failed with mysql')
mycli 连接:
mycli -h0.0.0.0 -utest -p1234 -P13306 db_kingshard
配置: