mysql客户端连接tidb报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

使用ansible搭建完成tidb集群,使用mysql客户端连接报错 及全配置 host1:tidbserver、pd host2:tikv host3:tikv host4:tikv

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

查看tidbserver、pd、tikv进程正常。 4000端口正常,使用grafana可以查看监控信息 tikv日志中有报错: [2019/08/07 11:22:02.898 +08:00] [INFO] [peer.rs:1023] ["[region 30] 31 notify pd with change peer region id: 30 start_key: “t2000000000000003773500000000000000370” end_key: “t2000000000000003773700000000000000370” region_epoch {conf_ver: 5 version: 12} peers {id: 31 store_id: 1} peers {id: 55 store_id: 5} peers {id: 60 store_id: 4}"] [2019/08/07 11:22:36.124 +08:00] [ERROR] [endpoint.rs:441] [“Region(message: “peer is not leader” not_leader {region_id: 22 leader {id: 46 store_id: 5}})”]

链接语句不对。。。???

之前用的是 mysql -u root -P 4000 报错(见上)

使用该方法密码不对: [root@tidb1 log]# mysql -u root -h 192.168.10.201 -P 4000 -p Enter password: ERROR 1045 (28000): Access denied for user ‘root’@‘192.168.10.201’ (using password: YES)

使用该方式,修改密码: mysql -u root -h 172.16.10.1 -P 4000