please use a valid, non-local hostname or IP. localhost can only be used with sandbox MySQL instance

问题描述

MySQL InnoDB Cluster配置过程中出错,版本5.7.24

 MySQL  localhost:3307  JS > var cluster = dba.createCluster('myCluster');
A new InnoDB cluster will be created on instance 'root@localhost:3307'.

Validating instance at localhost:3307...

This instance reports its own address as cmiot1

Instance configuration is suitable.
Creating InnoDB cluster 'myCluster' on 'root@localhost:3307'...
Dba.createCluster: To add an instance to the cluster, please use a valid, non-local hostname or IP. localhost can only be used with sandbox MySQL instances. (RuntimeError)

根据错误提示,在使用shell时不可使用localhost连接,而应该使用有效的非localhost名和ip作为连接名,应为localhost只在沙箱环境实例中使用。

解决方法

退出MySQL Shell

 MySQL  localhost:3307  JS > \q

利用ip连接shell

[root@cmiot1 mysqlmaster]# mysqlsh
 MySQL  JS > shell.connect('root@192.168.233.136:3307');

再次按照创建集群的步骤即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值