首页 > 数据库 >com.mysql.cj.exceptions.UnableToConnectException: Public Key Retrieval is not allowed报错处理

com.mysql.cj.exceptions.UnableToConnectException: Public Key Retrieval is not allowed报错处理

时间:2023-07-12 20:13:51浏览次数:39  
标签:cj java allowed reflect 报错 mysql exceptions

在做学成在线项目时,启动项目报错:
com.mysql.cj.exceptions.UnableToConnectException: Public Key Retrieval is not allowed
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)

解决方法:
在mysql连接的url最后加上allowPublicKeyRetrieval=true。

如果加上之后还报错,把target目录删掉,重新运行即可。

标签:cj,java,allowed,reflect,报错,mysql,exceptions
From: https://www.cnblogs.com/wefriend/p/17548690.html

相关文章

  • ImageMagick:报错:error while loading shared libraries: libjpeg.so.9(ImageMagick 7
    一,报错的例子:1,报错信息[root@localhostwork]#identify-listformatidentify:errorwhileloadingsharedlibraries:libjpeg.so.9:cannotopensharedobjectfile:Nosuchfileordirectory2,原因:imagemagick在调用jpeg的动态链接库时找不到相应的文件,所以报......
  • JMeter脚本报错:Cannot find engine named: 'javascript'的解决方法
    本文将介绍如何解决在JMeter版本5.4.1下执行脚本时出现的错误信息“javax.script.ScriptException:Cannotfindenginenamed:'javascript'”。通过将本地JDK版本从18.0.1.1更改为1.8.0_151来解决此问题。当使用JMeter进行脚本执行时,有时可能会遇到以下错误信息:javax.script......
  • k8s集群node NotReady处理流程-->kubelet状态error,并伴有报错:kubelet.service has mor
    k8s集群nodeNotReady处理流程-->kubelet状态error//20230712集群有节点NotReadykubelet状态error,并伴有报错:kubelet.servicehasmorethanoneExecStart=setting,whichisonlyallowedforType=oneshotservices.Refusing在此记录一下解决流程解决流程问题定位:使......
  • 报错知识库
    1.python项目部署报错pthread_createfailedforthread13of48:Resourcetemporarilyunavailable报错说明:线程数不够1)排错过程:ulimit-a查看docker基础镜像其中openfiles为一个任务打开的最大进程数maxuserprocesses为当前用户同时打开的最大进程数,(-u)unlimited为......
  • npm 安装报错-错误集景-持续更新
    错误信息npmERR!codeERESOLVEnpmERR!ERESOLVEunabletoresolvedependencytreenpmERR!npmERR!Found:[email protected]!node_modules/eslintnpmERR!deveslint@"7.15.0"fromtherootprojectnpmERR!peereslint@">=1.6.0&quo......
  • 解决docker报错Job for docker.service failed because start of the service was att
    转载自:https://blog.csdn.net/Along_168163/article/details/124118833=================== docker安装之后重新安装报错如下:Jobfordocker.servicefailedbecausestartoftheservicewasattemptedtoooften.See"systemctlstatusdocker.service"and"journa......
  • Redis 命令行中报错 (error) NOAUTH Authentication required
    本文来源:redis客户端连接错误NOAUTHAuthenticationrequired_Redis_脚本之家redis客户端连接成功,但是操作报异常——(error)NOAUTHAuthenticationrequired错误的含义是说你没有认证,说明没有使用密码连接查看密码:进入redis的安装目录,查看redis.config文件,viredis.conf......
  • rust-bindgen报错 ‘Unable to find libclang的解决办法
    Windows下面可能会遇到这个问题的解决方案:1)把LLVM安装到没有空格的路径。2)LIBCLANG_PATH的值不要加双引号。thread'main'panickedat'Unabletofindlibclang:"couldn'tfindanyvalidsharedlibrariesmatching:['clang.dll','libclang.dll'],setth......
  • django python manage.py migrate 后报错字段长度超了 django.db.utils.OperationalE
     现象:在models.py将CharField字段的maxlength=修改后,执行ythonmanage.pymigrate 报错django.db.utils.OperationalError:(1118 'Rowsizetoolarge.Themaximumrowsizefortheusedtabletype,notcountingBLOBs,is65535.Thisincludes storageoverhead,c......
  • django_filters/rest_framework/form.html的报错问题
    报错问题:django_filters/rest_framework/form.htm报错原因为:1没有装django_filters模块使用pip安装pipinstalldjango-filter2模块没有在配置文件中注册:将django_filters添加到installed_apps中INSTALLED_APPS=[...'django_filters',] ......