重新测试,Eclipse,Idea 两个工具,两个jdbc测试项目,都报了类似的错误,貌似真的指向了同一个问题!
因上一个问题:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
链接:https://segmentfault.com/q/10...
win10, 虚拟机 centos7,docker, mysql5.7 环境。
用Eclipse做的测试项目报上述错误;
用Idea做的SpringBoot 测试项目也报类似错误如下:
2019-04-02 22:08:40.256 ERROR 27680 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} init error
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
... (省略)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method) ~[na:1.8.0_181]
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) ~[na:1.8.0_181]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_181]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_181]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_181]
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) ~[na:1.8.0_181]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_181]
at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_181]
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.MysqlIO.(MysqlIO.java:301) ~[mysql-connector-java-5.1.47.jar:5.1.47]
... 105 common frames omitted
当前在修改mysql的 配置文件中的 wait_timeout 属性,一起没有成功。
执行 docker exec -it e1066fe2db35 /bin/bash 后,
无法使用 vi 编辑文件,
请问如何操作 ?
注:docker 环境下已经安装 VIM。