1.出现时区报错
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.
应当在数据库名称末尾添加?serverTimezone=UTC
DriverManager.getConnection("jdbc:mysql:///test?serverTimezone=UTC", "root", "123456");
2.中文输入变成???
sql里添加的中文数据在数据库中的显示为???
应当在数据库名称末尾添加?characterEncoding=utf8
DriverManager.getConnection("jdbc:mysql:///test?serverTimezone=UTC&characterEncoding=utf8", "root", "123456");