eclipse——Java连接MySQL遇到的问题
Java连接MySQL遇到的问题
①Could not create connection to database server.
原因:驱动包版本不一致
解决:重新导入与MySQL版本一致的jar包
②出现警告:Establishing SSL connection without server’s identityverification 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 optionisn’t set. For compliance with existing applications not using SSL theverifyServerCertificate property is set to ‘false’. You need either toexplicitly disable SSL by setting useSSL=false, or set useSSL=true and providetruststore for server certificate verification.
解决:https://blog.csdn.net/Amluee/article/details/80610286
③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.
解决:上面的链接也有讲到,在DriverManager.getConnection(URL,用户名,密码)
方法的URL里面加上
&serverTimezone=Hongkong
上一篇: eclipse 连接 mysql
下一篇: XML的文档类型定义文件——DTD