EDA365电子论坛网

标题: mysql连接报错:ERROR 2002 (HY000):Can't connect to MySQL server on '172.18.0.... [打印本页]

作者: littlestupid    时间: 2021-9-9 10:00
标题: mysql连接报错:ERROR 2002 (HY000):Can't connect to MySQL server on '172.18.0....

0 k. S' c1 ?$ ^7 e  e" i0 F" j使用MySQL客户端连接远程amoeba进行远程控制数据库报错:- b, m1 w2 V1 K* S, g4 w" b. @, _

( u+ D, U; u; n3 ~root@uduntu:~# mysql -u root -P8066  -h 172.18.0.4 -p1 ]7 K2 g4 x6 ?/ Q/ P. F
Enter password: 6 q* ?2 Z/ S. l+ V
ERROR 2002 (HY000): Can't connect to MySQL server on '172.18.0.4' (115)
' o% Y  v! V! D' v) D- V6 g, o6 Y9 k+ f3 D. U3 `# t0 M
求解答????在线等谢谢,可进行远程协调
作者: youOK    时间: 2021-9-9 13:23
为啥一看到程序,就头大
作者: thinkfunny    时间: 2021-9-9 13:24
Maybe the root is not allowed to connect mysql server from a remoting host. I advise you to create a new user instead of root.$ `' s% E, d$ l( Z) R# J
7 m. n, H, h6 W! V- [/ [
create user 'joey'@'%' identified by 'yourpassword';
1 ?( B) }$ V' Ggrant all privileges on yourdb.* to 'joey'@'%'
  ^( ^$ f8 a- U* ]you can replace '%' with your host(if not, connecting mysql server from every remoting host is allowed)
作者: xiaogegepcb    时间: 2021-9-9 13:26
是不是应该检查下 mysql服务是否开了远程权限




欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/) Powered by Discuz! X3.2