java.sql.SQLException: Connections could not be acquired from the underlying database!

在网上看了好多博客 很烦...

改了好多东西,一直不行,翻了翻提示才发现我的问题了


看这个    java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents

百度了一下这个说是 时区错误

都是最新版mysql连接jar包惹的祸(我用的是 mysql-connector-java-8.0.11.jar)


这是mysql的配置文件,划红线的是需要注意的地方

	@Test
	public void testDataSource() throws SQLException {
		DataSource ds =  ac.getBean(DataSource.class);
		System.out.println("..."+ds.getConnection());
	}

这是我的测试方法,所以最下面会有三个省略号


猜你喜欢

转载自blog.csdn.net/qq_37638061/article/details/81056184