yiding_he 发表于 2017-3-15 13:19:02

启动时无法连接非标准端口的 MySQL

如下图,已经修改了 src\main\resources\jeecg\jeecg_database.properties,



然后用 tomcat7:run 运行,发现报错:

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
        at sun.reflect.GeneratedConstructorAccessor58.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1121)
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:358)

调试发现 druid 仍然尝试连接 3306 端口。不知道是否还有其他地方的配置没改?



yiding_he 发表于 2017-3-15 13:29:47

找到原因了,这貌似是一个被丢弃的配置文件,实际的数据库配置是另一个文件。
页: [1]
查看完整版本: 启动时无法连接非标准端口的 MySQL