在做学成在线项目时,启动项目报错:
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