更新MySQL8.0需要注意的异常问题
1.启动异常报错:
javascript用什么打开
哪个网站下载源码最好java.sql.SQLException: Unknown character set index for field '255' received from server.
原因: MYSQL 5.5 之前, UTF8 编码只⽀持1-3个字节;从MYSQL5.5开始,可⽀持4个字节UTF编码utf8mb4。 mysql-connector-java.jar 的版本问题。mysql的jar包低版本不⽀持utf8mb4,连接时报错"Unknown character set index for field '255' received from server."升级⾼⼀点的 mysql-connector-java.jar 版本之后就解决了。
2.启动异常报错:
java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either 原因:时区的错误导致异常,我们只需要设置完毕系统的时区即可。这⾥的GMT%2B8代表东⼋区。
警告异常:
Tue Jul 31 19:46:30 CST 2018 WARN: Establishing SSL connection without server's identity verificatio
n 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.
原因:不建议在没有服务器⾝份验证的情况下建⽴SSL连接。根据MySQL 5.5.45 +、5.626+和5.7.6+的要求,如果没有设置显式选项,默认情况下必须建⽴SSL连接。对于不使⽤SSL的现有应⽤程序,verifyServerCertificate属性设置为“false”。您需要通过设置
bar是胸罩吗
useSSL=false来显式禁⽤SSL,或者设置useSSL=true,并为提供⽤于服务器证书验证的信任库。
我们将配置⽂件中datasource的URL 改为 :
mysql面试题常问
3.启动警告:
Loading class `sql.jdbc.Driver'. This is deprecated. The new driver class is `sql.cj.jdbc.
navigator服装品牌
Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
原因:加载类'sql.jdbc.Driver' 已经过时了。新的驱动类是“sql.cj.jdbc.Driver”。驱动程序通过SPI⾃动注册,⽽⼿动加载类通常是不必要的。eclipse打开
我们只需要把 sql.jdbc.Driver 改为 sql.cj.jdbc.Driver 即可

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。