mysql客户端连接不上

【产品名称】

【产品版本】3.1.0

【问题描述】

如果端口都没有调整的话,2881端口是直连的端口,你访问的是走的obproxy

可以把 obd cluster edit-config your_clustername的完整输出贴出来一下看看端口的规划。

用这个配置https://gitee.com/oceanbase/obdeploy/blob/master/example/mini-single-example.yaml

把#sqluser01去掉后再登录。

走直连还是obproxy的方式登录可以参考官方的示例:

https://www.oceanbase.com/docs/oceanbase-database/oceanbase-database/V3.1.2/connect-to-a-mysql-tenant-by-using-a-mysql-client-1

我用租户直连是没问题的,(obclient -h192.168.1.30 -P2881 -uroot@test_tenant -A -c),但是我参考官方文档带上用户就不行了(obclient -h192.168.1.30 -usqluser01@test_tenant#c1 -P2881 -p123456 -c -A oceanbase)

1、确认sqluser01用户是租户test_tenant下的吗?可以使用root@test_tenant登录后select user,host,password from mysql.user where user='sqluser01'; 确认一下

2、直连的时候不用写集群名,即你这里的#c1