解决方案:Unable to create requested service/Error calling Driver#connect

org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
.......
Caused by: org.hibernate.exception.JDBCConnectionException: Error calling Driver#connect
........	
	
Caused by: java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.
.......

问题处在mysql驱动的版本问题上
出问题前使用的mysql是5.1.41

  
        <dependency>
            <groupId>org.hibernategroupId>
            <artifactId>hibernate-coreartifactId>
            <version>5.0.12.Finalversion>
        dependency>
        
        <dependency>
            <groupId>mysqlgroupId>
            <artifactId>mysql-connector-javaartifactId>
            <version>5.1.41version>
        dependency>

之后改成更高一些的版本

 <dependency>
           <groupId>mysqlgroupId>
           <artifactId>mysql-connector-javaartifactId>
           <version>8.0.17version>
       dependency>

改成更高版本后驱动就不能在使用过时的com.mysql.jdbc.Driver
改成com.mysql.cj.jdbc.Driver

你可能感兴趣的:(error)