【Mysql】连接数据库时报错Unknown system variable 'query_cache_size'

驱动jar包版本与数据库版本不匹配

如果还报错:

Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: 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.
    at sun.reflect.GeneratedConstructorAccessor36.newInstance(Unknown Source)

那么,8.0版本的url请使用

jdbc:mysql://localhost:8888/gossip?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&useSSL=true

发布了110 篇原创文章 · 获赞 25 · 访问量 16万+

猜你喜欢

转载自blog.csdn.net/qq_32117641/article/details/104024727