美文网首页
MySQL8客户端无法连接?

MySQL8客户端无法连接?

作者: 忘记_3a6a | 来源:发表于2020-03-08 15:22 被阅读0次

1.MySQL8客户端无法连接?

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
FLUSH PRIVILEGES;

2.java连接MySQL8问题:

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.
  • 解决方法:
    com.mysql.jdbc.Driver --> com.mysql.cj.jdbc.Drive

连接时间不同

org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: 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.

查询数据库时出错。原因:java.sql。SQLException异常:服务器时区价值”Oйu±e×¼e±¼的识别或代表多个时区。如果希望利用时区支持,必须配置服务器或JDBC驱动程序(通过serverTimezone配置属性)以使用更特殊的时区值。

这个是解决中文乱码输入问题
jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8
jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC

相关文章

网友评论

      本文标题:MySQL8客户端无法连接?

      本文链接:https://www.haomeiwen.com/subject/amgddhtx.html