关于使用客户端登录ob server版本显示疑问

【产品名称】

3.1.3-OceanBase CE

【产品版本】

[admin@localhost ~]$ obclient --version

obclient Ver 15.1 Distrib 10.4.18-MariaDB, for Linux (x86_64) using readline 5.1

OceanBase 3.1.3

【问题描述】

[admin@localhost ~]$ obclient -h127.0.0.1 -uroot@my_tenant -P2881 -p’root123’ -c -A test Welcome to the OceanBase. Commands end with ; or \g. Your MySQL connection id is 3221490143 Server version: 5.7.25 OceanBase 3.1.3 (r10100032022041510-a09d3134c10665f03fd56d7f8bdd413b2b771977) (Built Apr 15 2022 02:16:22) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. MySQL [test]> \q Bye [admin@localhost ~]$ obclient -h127.0.0.1 -uroot@my_tenant -P2883 -p’root123’ -c -A test Welcome to the OceanBase. Commands end with ; or \g. Your MySQL connection id is 25 Server version: 5.6.25 OceanBase 3.1.3 (r10100032022041510-a09d3134c10665f03fd56d7f8bdd413b2b771977) (Built Apr 15 2022 02:16:22) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. 使用obclient和mysql连接不同端口,而显示的server version不同,是什么原因导致? 连接2881端口显示Server version: 5.7.25 OceanBase 3.1.3 (r10100032022041510-a09d3134c10665f03fd56d7f8bdd413b2b771977) (Built Apr 15 2022 02:16:22) MySQL [information_schema]> select version(); ±-------------------+ | version() | ±-------------------+ | 3.1.3-OceanBase CE | ±-------------------+ 1 row in set (0.001 sec) MySQL [information_schema]> show variables like ‘%version%’; ±------------------------±-----------------------------------------------------------------------------------------------------------+ | Variable_name | Value | ±------------------------±-----------------------------------------------------------------------------------------------------------+ | ob_last_schema_version | 0 | | protocol_version | 10 | | tls_version | | | version | 3.1.3-OceanBase CE | | version_comment | OceanBase 3.1.3 (r10100032022041510-a09d3134c10665f03fd56d7f8bdd413b2b771977) (Built Apr 15 2022 02:16:22) | | version_compile_machine | | | version_compile_os | | ±------------------------±-----------------------------------------------------------------------------------------------------------+ 连接2883端口显示Server version: 5.6.25 OceanBase 3.1.3 (r10100032022041510-a09d3134c10665f03fd56d7f8bdd413b2b771977) (Built Apr 15 2022 02:16:22) MySQL [test]> select version(); ±-------------------+ | version() | ±-------------------+ | 3.1.3-OceanBase CE | ±-------------------+ 1 row in set (0.003 sec) MySQL [test]> show variables like ‘%version%’; ±------------------------±-----------------------------------------------------------------------------------------------------------+ | Variable_name | Value | ±------------------------±-----------------------------------------------------------------------------------------------------------+ | ob_last_schema_version | 0 | | protocol_version | 10 | | tls_version | | | version | 3.1.3-OceanBase CE | | version_comment | OceanBase 3.1.3 (r10100032022041510-a09d3134c10665f03fd56d7f8bdd413b2b771977) (Built Apr 15 2022 02:16:22) | | version_compile_machine | | | version_compile_os | | ±------------------------±-----------------------------------------------------------------------------------------------------------+ 7 rows in set (0.005 sec)

我没有找到问题,能不能做出标记?

提示的mysql的版本应该只是做兼容用的,没有什么实际意义。

OceanBase 3.1.3与MySQL的5.65.7都兼容,如果开始指定的数据库是MySQL,就很正常!


一个是2881 observer,一个是2883 obproxy,软件不一样版本才不一样的

如果没什么实际意义,可以选择只显示oceanbase的版本,这样比较合理点?

你指的是兼容mysql 5.6和mysql 5.7客户协议,还是内核功能,兼容多个版本没问题,但是连接显示不同是有别的考虑吗?比如想mysql 8以后server和client版本是保持一致的

简单理解没错的,2881相当于直连ob,2883相当于连接obproxy的连接池,我想说的是版本规划上可以采取统一,这样对于维护和升级清晰

我理解这里显示的5.7,5.6只是个空壳用来兼容程序的,无需关注。你去看代码的话应该是写死的,某些程序连接的时候可能会去检查这个东西,我了解的兼容mysql的数据库都会去做这个。

只是对MySQL协议实现的一个版本号显示。应该是无需关注的。协议报文基本都是向下兼容,主要还是看OBserver执行的功能