mysql连接

 
  
Class.forName("com.mysql.cj.jdbc.Driver");String url = "jdbc:mysql://127.0.0.1:3306/spring?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";String user="root";String password = "root";
Connection connection = DriverManager.getConnection(url,user,password);

针对warn,要求设置为false,要么设置为true,然后怎么怎么样的那个。
jdbc:mysql://127.0.0.1:3306/schema名字?&useSSL=false

错误:“The server time zone value '�й���׼ʱ��' is unrecognized or represents more t”

解决:连接语句后面添加:&serverTimezone=UTC

jdbc:mysql://127.0.0.1:3306/schema名字?&serverTimezone=UTC

你可能感兴趣的:(数据库)