将MySQL升级到8.0.x后的遇到到错误及解决
2024-08-23 15:32:36
一,安装的时遇到的坑
我下的是Mysql 8.0.13
下的是解压版(个人能不用安装就不想用安装版的强迫症(/▽\))
然后问题就来了:
解压后还要初始化,命令是:
mysqld --initialize --user=mysql --console
然后我就一直会有错误,导致初始化出问题。
配置好环境变量,然后用cmd管理员权限才成功(没成功的话可能就是没用管理员权限)
初始化出来的临时密码要记起来,最好就安装完及改掉,要不然就麻烦。
二,eclipse中启动项目时出错
①第一个Error:MySQLNonTransientConnectionException
MySQLNonTransientConnectionException:
Client does not support authentication protocol requested by server; consider upgrading MySQL client
错误原因:MySQL的驱动不支持了
解决:下载最新的适合的驱动;
下载链接:https://dev.mysql.com/downloads/connector/j/
选择平台独立,然后下载。
②第二个Error:Loading class…
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.Driver’。
解决:将驱动的代码改为新的,我做的一个是SSH的 ,将jdbc.properties中的
jdbc.driver = com.mysql.jdbc.Driver
改为==>
jdbc.driver = com.mysql.cj.jdbc.Driver
③第三个Error:The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized
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.
错误原因:它说时区不能识别,需要指定时区
解决:在uri链接上加上时区的参数指定时区。
jdbc.url = jdbc:mysql:///artexam?serverTimezone=UTC
④第四个Error:Public Key Retrieval is not allowed
当我重启数据库的时候,再次启动项目就报了这个错:
Public Key Retrieval is not allowed
解决:在参数上给它带上允许
jdbc.url = jdbc:mysql:///manxc?serverTimezone=UTC&allowPublicKeyRetrieval=true
最新文章
- JDBC 练习
- 用js把数据从一个页面传到另一个页面
- 高级搜索插件solis search在umbraco中的使用
- Apache多站点实现原理和配置
- 再谈 X-UA-Compatible 兼容模式
- Ajax调用WebService
- ruby on rails揭开route路由的真面目
- cisco telnet会话SESSION管理及相关Dynagen配置文件
- 零基础学python-2.8 字典
- Linux 环境下程序不间断运行
- Java的字符串分割的不同实现
- CentOS 6.X启动流程
- C Primer Plus 第10章 数组和指针 编程练习
- eclipse 开发web 项目,使用gradle 需要安装的插件
- Android应用系列:值得收藏的ViewHolder工具类实现
- YGC和FGC发生时间
- C#-----------------------------回收机制中Destroy与null的作用
- vs2013 update 2 cordova(phonegap) 环境
- 简单的redis工具类
- (转)《SSO CAS单点系列》之 实现一个SSO认证服务器是这样的!
热门文章
- c# 第六节 c#的程序结构,以及vs的文件结构
- eth0: ERROR while getting interface flags: No such device的解决方法、Linux怎么修改IP以及ping不通的处理方法
- RST复位报文
- spark 配置
- LeetCode 1257. Smallest Common Region
- 2016年蓝桥别A组模拟训练
- [LeetCode] 746. Min Cost Climbing Stairs 爬楼梯的最小损失
- [LeetCode] 694. Number of Distinct Islands 不同岛屿的个数
- Spring Cloud Gateway 之 AddRequestHeader GatewayFilter Factory
- Idea用maven给springboot打jar包