Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
三、MySQL 高版本配置加载驱动类包出错问题(以 MySQL 8.0 为例)
这个错误是由于 MySQL 版本更新之后,驱动包发生改变导致的,新的驱动程序类是 com.mysql.cj.jdbc.Driver。 3.1、错误产生描述
报错如下:
Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2020-01-14 00:45:30,876 ERROR [DruidDataSource.java:616] : init datasource error 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.
另外在 MySQL 中的 my.ini 配置文件也可以修改,此文章仅用于解决相应问题,故不多做详细描述。 六、SSL 连接问题 6.1、错误产生描述
报错如下:
Sun Oct 14 00:45:30 CST 2018 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.
总结
通过对于 MySQL 抛出异常的几种常见解决方式的总结,加深对于 MySQL 底层的了解。只要是干开发,错误是不断地,要善于总结。同时,要充分掌握开发的底层原理,不同的版本迭代作为开发者要及时了解,不然永远跟不上技术的发展。
以上就是分析MySQL抛出异常的几种常见解决方式的详细内容,更多关于MySQL异常的解决方式的资料请关注脚本之家其它相关文章!