java.sql.SQLException: Unable to load authentication plugin ‘caching_sha2_password‘解决

这篇具有很好参考价值的文章主要介绍了java.sql.SQLException: Unable to load authentication plugin ‘caching_sha2_password‘解决。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

最近遇到了 java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.这个报错。java.sql.sqlexception: unable to load authentication plugin 'caching_sha2_pa,Java,java,开发语言

主要原因8.x版本的验证模块和之前版本不同:

5.x版本是:default_authentication_plugin=mysql_native_password

8.x版本就是:default_authentication_plugin=caching_sha2_password
 

解决方案

①更新mysql驱动的jar版本,修改为8.0.11版本

<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.11</version>
</dependency>

②修改数据库配置driver为com.mysql.cj.jdbc.Driver(可以不改),url加上serverTimezone=UTC(这两个是8.x与5.x不同的配置)

java.sql.sqlexception: unable to load authentication plugin 'caching_sha2_pa,Java,java,开发语言文章来源地址https://www.toymoban.com/news/detail-812384.html

到了这里,关于java.sql.SQLException: Unable to load authentication plugin ‘caching_sha2_password‘解决的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • workbench 链接mysql 报错 authentication plugin caching_sha2_password

    用workbench连接MySQL出现Authentication plugin ‘caching_sha2_password’ cannot be loaded的问题,如下图 原因 出现这个问题的原因是由于Navicat和MySQL的版本问题, mysql8 之前,加密规则是mysql_native_password; mysql8 之后,加密规则是caching_sha2_password。 解决方法一种是升级Navicat驱动,一种是My

    2024年02月11日
    浏览(34)
  • 已解决Gradle错误:“Unable to load class ‘org.gradle.api.plugins.MavenPlugin‘”

    🌷🍁 博主猫头虎 带您 Go to New World.✨🍁 🦄 博客首页——猫头虎的博客🎐 🐳《面试题大全专栏》 文章图文并茂🦕生动形象🦖简单易学!欢迎大家来踩踩~🌺 🌊 《IDEA开发秘籍专栏》学会IDEA常用操作,工作效率翻倍~💐 🌊 《100天精通Golang(基础入门篇)》学会Golang语言

    2024年02月11日
    浏览(34)
  • Unable to load extension: pydevd_plugins.extensions.types.pydevd_plugin_pandas_types 丝滑解决

    以及试图打开jupyter notebook路径下的.ipynb文件时,出现报错:500 : internal server error jupyter notebook 看到有博客说是要重新安装Anoconda,这样太麻烦了,好比修房子的时候贴错了一块砖头,直接把整套房推倒重建了。有可能还得重新配置环境变量,重新安装库包,这里有个简单的方式

    2024年02月15日
    浏览(89)
  • MYSQL解决“plugin caching_sha2_password could not be loaded”

    目录         1. 登录mysql         2.查看用户的密码规则,及对应host          3.修改加密规则及密码(注意:下面代码的 % 是对应host中的内容) 概述 “ plugin caching_sha2_password could not be loaded”,是无法加载插件缓存sha2密码, 在MySQL 8.0中,caching_sha2_password是默认的

    2024年02月07日
    浏览(29)
  • jenkins java.io.IOException: Failed to load: Git plugin

    jenkins 的插件 http://updates.jenkins-ci.org/download/plugins/ jenkinsci/blueocean的插件 Jenkins Plugins 报错是更新Mailer插件的版本 可以在jenkins的插件管理中下载 或者在jenkins的插件中下载到本地然后再插件管理中上传         上传位置在高级里    在这里上传

    2024年02月11日
    浏览(35)
  • Failed to obtain JDBC Connection; nested exception is java.sql.SQLException

    Failed to obtain JDBC Connection; nested exception is 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 s

    2024年02月11日
    浏览(39)
  • 【MySQL异常】解决java.sql.SQLException: null, message from server: “Host xxx‘ is not allowed to connect to

    Spring Boot + MySQL 本机访问MySQL数据库正常(即使用 localhost 或者 127.0.0.1 两种方式)。局域网内同事的电脑访问我电脑的数据库结果报错。用户使用的是root用户,即超管账户。 查看防火墙设置,是否允许远程访问mysql数据库这个程序。经查看本机确实限制了不允许远程访问msy

    2024年02月04日
    浏览(33)
  • Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: com.mysql.jdbc.Driver

    记录idea报错, 1.引用外部库 mysql-connector-java-8.0.26 dependency       groupIdmysql/groupId       artifactIdmysql-connector-java/artifactId       version8.0.26/version /dependency   2. 引入最新版的c3p0 dependency     groupIdcom.mchange/groupId     artifactIdc3p0/artifactId     version0.9.5.5/version /dependency 3.连接的驱

    2024年02月02日
    浏览(35)
  • 解决java.sql.SQLException: null, message from server: “Host ‘XXX‘ is not allowed to connect异常

    今天弄Android studio的时候,数据库连接总是不行,一直超时没反应,仔细思考觉得是ip地址出了问题,在jdbc:mysql://xxxx:3306/DBname 这句语句中的xxxx具体写什么地址使我浪费了很多时间,不论是用公网ip地址还是私网ip地址还是本机地址127.0.0.1都没有用。 我公网ip地址和本机地址浪

    2023年04月09日
    浏览(77)
  • 出现java.sql.SQLException: Connection is read-only. Queries leading to data modification are not

    Springboot+mybatis修改操作时候,出现java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed; SQL []; Connection is read-only. Queries leading to data modification are not allowed; nested exception is java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed Conne

    2024年02月06日
    浏览(23)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包