使用的是野火distribution-0.29-bundle-tar.tar.gz版本,win10下启动,使用了mysql数据库
连接时报错:WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
java.sql.SQLException: The server time zone value '???ú±ê×??±??' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:87)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:61)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:71)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:862)
at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:444)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:230)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:226)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at win.liyufan.im.DBUtil.init(DBUtil.java:88)
at io.moquette.server.Server.startServer(Server.java:223)
at io.moquette.server.Server.startServer(Server.java:215)
at io.moquette.server.Server.startServer(Server.java:199)
at io.moquette.server.Server.start(Server.java:109)
at cn.wildfirechat.server.Server.main(Server.java:15)
网上找到解决方法:
1.jdbcUrl后面加参数?useSSL=false&serverTimezone='xx'
但还是报错,无法解决问题
2.根据野火的常见问题解决,直接修改mysql的时区
在mysql的配置文件my.ini中[mysqld]下配置default-time-zone = '+8:00',问题解决,mysql数据库可以连接了
但还是有警告:
WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
现在问题:
1.为什么jdbcUrl后面加参数确无法传递到mysql上呢,是flyway这个工具不支持参数传递吗?
2.每次部署需要修改mysql数据库配置,而不能通过jdbcUrl参数传递控制,造成部署不便,有什么修改方法吗?