java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.
原来是mysql5.X,升级到8.X,连接数据库就报错: Unable to load authentication plugin ‘caching_sha2_password’.
- 原因分析:
可能为安装了新的mysql,与项目配置中的jar包中驱动连接不兼容;
mysql8.x的新特性密码加密方式是 caching_sha2_password mysql
5.x密码加密使用的是 mysql_native_password
- 解决方法:
1.修改配置文件中的驱动配置:
1 //8.X版本
2 driverClassName=com.mysql.cj.jdbc.Driver;
3
4 //5.X版本的为:
5 driverClassName=com.mysql.jdbc.Driver;
2.删除lib文件夹中的mysql-connector-java-5.1.45-bin.jar(即5.X版本的jar包)
3.添加进新的8.X版本的jar包:mysql-connector-java-8.0.27
4.重启apach Tomcat服务,成功!
java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.的更多相关文章
- 连接mysql客户端报错: java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'
报这个错可能是因为用了低版本的的客户端.驱动连接高版本的mysql服务器. 解决方式有三种:升级客户端版本.修改服务端认证方式和适应服务端认证方式. 我是通过升级客户端版本解决,参考一下链接: Upg ...
- 连接mysql 出现:java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.
数据测试的时候出现: 网上查资料说的是mysql5.x 版本和 8.x版本的区别: 5.7版本是:default_authentication_plugin=mysql_native_password ...
- DBeaver连接MySQL 8.0显示"Unable to load authentication plugin 'caching_sha2_password'."错误的问题
下载MySQL绿色版本mysql-8.0.12-winx64,手动安装完成后.使用DBeaver连接提示"Unable to load authentication plugin 'cach ...
- Unable to load authentication plugin 'caching_sha2_password'
Caused by: com.mysql.cj.core.exceptions.WrongArgumentException: Unable to load authentication plugin ...
- 连接mysql出现“Unable to load authentication plugin 'caching_sha2_password”错误
这是mysql 8.0版本才出现的问题,原因是mysql 8.0 默认使用 caching_sha2_password 身份验证机制 -- 从原来的 mysql_native_password 更改为 ...
- Caused by: java.sql.SQLException: Failed to start database 'metastore_db' with class loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1@d7c365, see the next exception for details.
解决方法:https://stackoverflow.com/questions/37442910/spark-shell-startup-errors 异常: 18/01/29 19:04:27 W ...
- Oracle java.sql.SQLException: 数字溢出
六月 30, 2016 5:47:47 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinit ...
- java.sql.SQLException: 关闭的连接 解决办法
程序如果长时间不进行数据库操作,那么数据源中的 Connection 很可能已经断开.其原因有可能是防火墙,或者连接的数据库设置的超时时间.这里使用的是 C3P0 连接 oracle 数据库,引起的异 ...
- java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
org.springframework.dao.TransientDataAccessResourceException: ### Error updating database. Cause: ja ...
随机推荐
- 版本控制SVN
为什么需要版本控制软件 代码的冻结 避免在重大的考核之前改动代码 每个稳定版本都在服务器保存进度,随时可以回退 需求频繁的变化不要改动稳定的代码,不要改别人写好的代码 为什么需求会变化?有时候产品自己 ...
- 【struts2】中method={1}详解
我们在使用struts2的时候,有时候为了简化struts2的配置项而采用通配符的方式,如下代码: <action name="ajaxregister!*" class=& ...
- C++输入多行数据
动机 编程题常用需求,比如输入两行数据. 解决思路:使用getline 程序 #include <iostream> #include <vector> #include &l ...
- MATLAB基础学习(2)
function result=mysum(a,b)%创建函数以及外部接口 s=0; for i=a:b s=s+i; end result=s; disp(s); end Matlab中ones() ...
- Scala中实现break与continue
Scala是函数式编程语言,因此没有直接的break与continue关键字,要实现break与continue效果,需要绕一下. 需要导入包: import util.control.Breaks. ...
- 海康PTZ云台摄像头调试之直接控制云台(C#)
众所周知,海康的摄像头sdk较为完善,但是对于新手来说还是有点麻烦. 今天写一篇随笔给大家展示下怎么控制海康摄像头的云台(前提是有ptz云台设备) 1.sdk准备 本文基于C#的frame来开发一个p ...
- 《PHP程序员面试笔试宝典》——如何回答快速估算类问题?
如何巧妙地回答面试官的问题? 本文摘自<PHP程序员面试笔试宝典> 有些大企业的面试官,总喜欢出一些快速估算类问题,对他们而言,这些问题只是手段,不是目的,能够得到一个满意的结果固然是他们 ...
- Solution -「AGC 010C」「AT 2304」Cleaning
\(\mathcal{Description}\) Link. 给定一棵 \(n\) 个点的无根树,点有点权,每次选择两个不同的叶子,使它们间的简单路径的所有点权 \(-1\),问能否将所有点 ...
- Java IO模型:BIO、NIO、AIO
Java IO模型:BIO.NIO.AIO 本来是打算直接学习网络框架Netty的,但是先补充了一下自己对Java 几种IO模型的学习和理解.分别是 BIO.NIO.AIO三种IO模型. IO模型的基 ...
- hydra安装及破解rdp方法
hydra暴力破解工具 下载:https://github.com/vanhauser-thc/thc-hydra 安装步骤: ./configure make&&make insta ...