database-mesh/pisanix

when connect to mysql, an "InvalidPacket" error occurred.

dongzl opened this issue · 5 comments

Question

config.toml

# api 配置块,对应命令行参数和环境变量
[admin]
# api 地址
host = "0.0.0.0"
# api 端口
port = 8082
# 日志级别
log_level = "INFO"

# pisa-proxy 代理配置块
[proxy]
# config a proxy
[[proxy.config]]
# proxy 代理地址
listen_addr = "0.0.0.0:9088"
# proxy 认证用户名
user = "root"
# proxy 认证密码
password = "123456"
# proxy schema
db = "test"
# 配置后端数据源类型
backend_type = "mysql"
# proxy 与后端数据库建连连接池大小,值范围:1 ~ 255, 默认值:64
pool_size = 3
# 服务端版本
server_version = "5.7.37"

# 后端负载均衡配置
[proxy.config.simple_loadbalance]
# 负载均衡算法:[random/roundrobin], 默认值: random 算法
balance_type = "random"
# 选择挂载后端节点
nodes = ["ds001"]

[proxy.config.read_write_splitting]

[proxy.config.read_write_splitting.static]
default_target = "read"

[[proxy.config.read_write_splitting.static.rule]]
name = "read-rule"
type = "regex"
regex = [".*"]
target = "read"
algorithm_name = "random"

[[proxy.config.read_write_splitting.static.rule]]
name = "write-rule"
type = "regex"
regex = [".*"]
target = "readwrite"
algorithm_name = "roundrobin"

[[proxy.config.plugin.concurrency_control]]
regex = ["aaa"]
max_concurrency = 5
duration = 333

[[proxy.config.plugin.concurrency_control]]
regex = ["bbb"]
max_concurrency = 5
duration = 333

[[proxy.config.plugin.circuit_break]]
regex = ["111"]

[[proxy.config.plugin.circuit_break]]
regex = ["222"]

# 后端数据源配置
[mysql]
[[mysql.node]]
# 数据源 name
name = "ds001"
# database name
db = "employees"
# 数据库 user
user = "root"
# 数据库 password
password = "123456"
# 数据库地址
host = "127.0.0.1"
# 数据库端口
port = 3307
# 负载均衡节点权重
weight = 1
role = "read"

error msg:

Jul 05 16:08:35.864 ERROR runtime_mysql::server::server: exec command err: Error { kind: Protocol(InvalidPacket { method: "handle_auth_data", data: [0, 7, 4, 71, 42, 86, 92, 37, 19, 6, 56, 1, 125, 47, 111, 120, 24, 104, 3, 37, 61, 0] }) }

client:
image

Is the mysql version 5.7.37?

Is the mysql version 5.7.37?

8.0.28

Ok. I will try to reproduce.

Connect failed when changed user auth plugin to mysql_native_password on mysql 8.0.28.

image

Ok. I will try to reproduce.

When the MySQL server's authenticate mode is caching_sha2_password, pisa-proxy connect MySQL server OK.

But when I fix the authenticate mode to mysql_native_password, cause this error.