如何解决无法加载身份验证插件"caching_sha2_password"的问题 [英] How to resolve Unable to load authentication plugin 'caching_sha2_password' issue

查看:131
本文介绍了如何解决无法加载身份验证插件"caching_sha2_password"的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse中,当我启动我的应用程序时,我得到了-无法发现要使用的方言. java.sql.SQLException:无法加载身份验证插件"caching_sha2_password".

In eclipse when i started my application i got this - Could not discover the dialect to use. java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.

java.sql.SQLException上的

:无法加载身份验证插件 'caching_sha2_password'.在 com.mysql.jdbc.SQLError.createSQLException(SQLError.java:868)位于 com.mysql.jdbc.SQLError.createSQLException(SQLError.java:864)位于 com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1746) 在com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)在 com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2191) 在 com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2222) 在 com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2017) 在com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:779) 在com.mysql.jdbc.JDBC4Connection处(JDBC4Connection.java:47) 在sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 方法)在 sun.reflect.NativeConstructorAccessorImpl.newInstance(未知来源) 在 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(未知 源代码,位于java.lang.reflect.Constructor.newInstance(未知 源代码)位于com.mysql.jdbc.Util.handleNewInstance(Util.java:425) 在 com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389)位于 在 com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330) 位于at的java.sql.DriverManager.getConnection(Unknown Source) 处的java.sql.DriverManager.getConnection(未知源) ch.qos.logback.core.db.DriverManagerConnectionSource.getConnection(DriverManagerConnectionSource.java:54) 在 ch.qos.logback.core.db.ConnectionSourceBase.discoverConnectionProperties(ConnectionSourceBase.java:46) 在 ch.qos.logback.core.db.DriverManagerConnectionSource.start(DriverManagerConnectionSource.java:38) 在 ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:161) 在 ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309) 在 ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193) 在 ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179) 在 ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62) 在 ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165) 在 ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152) 在 ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110) 在 ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53) 在 ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75) 在 ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150) 在 org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)在 在 org.slf4j.impl.StaticLoggerBinder.(StaticLoggerBinder.java:55) 在org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)处 org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124) 在 org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)在 在 ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addStatus(StatusViaSLF4JLoggerFactory.java:32) 在 ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addInfo(StatusViaSLF4JLoggerFactory.java:20) 在 ch.qos.logback.classic.servlet.LogbackServletContainerInitializer.onStartup(LogbackServletContainerInitializer.java:32) 在 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5245) 在 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 在 org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1421) 在 org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1411) 在java.util.concurrent.FutureTask.run(未知来源)在 java.util.concurrent.ThreadPoolExecutor.runWorker(未知源),位于 在java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源) 在java.lang.Thread.run(未知源)上

at java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'. at at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:868) at at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:864) at at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1746) at at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226) at at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2191) at at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2222) at at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2017) at at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:779) at at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47) at at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at at java.lang.reflect.Constructor.newInstance(Unknown Source) at at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389) at at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330) at at java.sql.DriverManager.getConnection(Unknown Source) at at java.sql.DriverManager.getConnection(Unknown Source) at at ch.qos.logback.core.db.DriverManagerConnectionSource.getConnection(DriverManagerConnectionSource.java:54) at at ch.qos.logback.core.db.ConnectionSourceBase.discoverConnectionProperties(ConnectionSourceBase.java:46) at at ch.qos.logback.core.db.DriverManagerConnectionSource.start(DriverManagerConnectionSource.java:38) at at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:161) at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309) at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193) at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179) at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53) at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75) at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150) at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84) at at org.slf4j.impl.StaticLoggerBinder.(StaticLoggerBinder.java:55) at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150) at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124) at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412) at at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addStatus(StatusViaSLF4JLoggerFactory.java:32) at at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addInfo(StatusViaSLF4JLoggerFactory.java:20) at at ch.qos.logback.classic.servlet.LogbackServletContainerInitializer.onStartup(LogbackServletContainerInitializer.java:32) at at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5245) at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421) at at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411) at at java.util.concurrent.FutureTask.run(Unknown Source) at at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at at java.lang.Thread.run(Unknown Source)

推荐答案

从MySQL 8.0.4开始,他们更改了默认设置 MySQL服务器的身份验证插件,从 mysql_native_password caching_sha2_password .

Starting with MySQL 8.0.4, they have changed the default authentication plugin for MySQL server from mysql_native_password to caching_sha2_password.

您可以运行以下命令来解决此问题.

You can run the below command to resolve the issue.

示例用户名/密码=>学生/pass123

sample username / password => student / pass123

ALTER USER 'student'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pass123';

有关详细信息,请参考官方页面: MySQL参考手册

Refer the official page for details: MySQL Reference Manual

这篇关于如何解决无法加载身份验证插件"caching_sha2_password"的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆