MySQL ERROR 2007 (HY000):协议不匹配;服务器版本 = 11,客户端版本 = 10

MySQL ERROR 2007 (HY000):协议不匹配;服务器版本 = 11,客户端版本 = 10

目前尚不清楚这是否与端口冲突或与“X 协议”相关的事情有更多关系,并且可能禁用“X 协议”或更改其欢迎消息。


可能错误表明端口冲突?作为:

添加或更改的功能

Important Change: Attempting to connect to an X Protocol port, 33060 by default, using the classic MySQL protocol resulted in the

以下错误:错误 2013 (HY000):在“读取初始通信数据包”时丢失与 MySQL 服务器的连接,系统错误:0

This was because of differences in X Protocol and classic MySQL protocol clients expectations on how connections were initialized.

现在,在这种情况下,生成的错误消息是 ERROR 2007 (HY000):协议不匹配;服务器版本= 11,客户端版本= 10。如果您遇到此错误,那么您可能正在尝试对客户端正在使用的协议使用错误的端口。

alice容器bob已创建使用docker,两者都来自hubmysql-server上的默认图像docker。我是尝试连接alicebob使用MySQL控制台。

alice安装后从主机登录iputilstelnet使用yum

bash-4.2# 
bash-4.2# ping bob
PING bob (172.21.0.3) 56(84) bytes of data.
64 bytes from bob.foo (172.21.0.3): icmp_seq=1 ttl=64 time=0.064 ms
64 bytes from bob.foo (172.21.0.3): icmp_seq=2 ttl=64 time=0.084 ms
64 bytes from bob.foo (172.21.0.3): icmp_seq=3 ttl=64 time=0.086 ms
^C
--- bob ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2047ms
rtt min/avg/max/mdev = 0.064/0.078/0.086/0.009 ms
bash-4.2# 
bash-4.2# telnet bob
Trying 172.21.0.3...
telnet: connect to address 172.21.0.3: Connection refused
bash-4.2# 
bash-4.2# telnet bob 33060
Trying 172.21.0.3...
Connected to bob.
Escape character is '^]'.

�^CConnection closed by foreign host.
bash-4.2# 
bash-4.2# telnet bob 3306 
Trying 172.21.0.3...
Connected to bob.
Escape character is '^]'.
CHost '172.21.0.2' is not allowed to connect to this MySQL serverConnection closed by foreign host.
bash-4.2# 
bash-4.2# mysql mysql -h bob -P 33060 --protocol=tcp -u root -p
Enter password: 
ERROR 2007 (HY000): Protocol mismatch; server version = 11, client version = 10
bash-4.2# 

如何将客户端版本更新到11?来自爱丽丝:

bash-4.2# 
bash-4.2# rpm -qa | grep mysql
mysql80-community-release-el7-3.noarch
mysql-shell-8.0.21-1.el7.x86_64
mysql-community-minimal-release-el7-1.noarch
mysql-community-server-minimal-8.0.21-1.el7.x86_64
bash-4.2# 

和鲍勃应该是一样的。

或者,这是一个安全预防?


我又试了一次,指定不同的端口但有同样的错误。

也可以看看:

https://forums.mysql.com/read.php?152,684386,686543#msg-686543

答案1

确保该端口上没有其他程序运行。所以停止mysql,看看是否仍然会出现同样的错误。如果是这样,则说明您尝试使用的端口上正在运行其他程序。

相关内容