In the Spring boot project using the MySQL database for database additions and deletions, the following error occurred:
Error starting ApplicationContext. To display the Auto-configuration report re-run your application with ' debug ' enabled.2017-06-15 15:04:37.122 ERROR 10072 ---[Restartedmain] o.s.boot.springapplication:application startup Failedorg.springframework.beans.facto Ry. Beancreationexception:error creating Bean with Name ' entitymanagerfactory ' defined in class path resource [Org/springfram Ework/boot/autoconfigure/orm/jpa/hibernatejpaautoconfiguration.class]: Invocation of Init method failed; Nested exception is javax.persistence.PersistenceException: [Persistenceunit:default] Unable to build Hibernate Sessionfactory at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1628) ~[spring-beans-4.3.8.release.jar:4.3.8.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:555) ~[SPRING-BEANS-4.3.8.RELEASE.JAr:4.3.8.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:483) ~[spring-beans-4.3.8.release.jar:4.3.8.release] at Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (abstractbeanfactory.java:306) ~[ Spring-beans-4.3.8.release.jar:4.3.8.release] At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:230) ~[spring-beans-4.3.8.release.jar:4.3.8.release] at Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:302) ~[ Spring-beans-4.3.8.release.jar:4.3.8.release] At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:197) ~[ Spring-beans-4.3.8.release.jar:4.3.8.release] At Org.springframework.context.support.AbstractApplicationContext.getBean (abstractapplicationcontext.java:1081) ~[ Spring-context-4.3.8.release.jar:4.3.8.RELEASE] at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (abstractapplicationcontext.java:856) ~[spring-context-4.3.8.release.jar:4.3.8.release] at Org.springframework.context.support.AbstractApplicationContext.refresh (abstractapplicationcontext.java:542) ~[ Spring-context-4.3.8.release.jar:4.3.8.release] At Org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh ( embeddedwebapplicationcontext.java:122) ~[spring-boot-1.5.3.release.jar:1.5.3.release] at Org.springframework.boot.SpringApplication.refresh (springapplication.java:737) [Spring-boot-1.5.3.release.jar : 1.5.3.RELEASE] at Org.springframework.boot.SpringApplication.refreshContext (springapplication.java:370) [ Spring-boot-1.5.3.release.jar:1.5.3.release] at Org.springframework.boot.SpringApplication.run ( springapplication.java:314) [Spring-boot-1.5.3.release.jar:1.5.3.release] at Org.springframework.boot.SpringApplication.run (springapplication.java:1162) [Spring-boot-1.5.3.release.jar:1.5.3.release] at Org.springframework.boot.SpringApplication.run (springapplication.java:1151) [Spring-boot-1.5.3.release.jar:1.5.3.release] at Com.wyl.App.main (app.java:16) [Classes/:na] at Sun.reflect.NativeM ETHODACCESSORIMPL.INVOKE0 (Native Method) ~[na:1.8.0_60] at Sun.reflect.NativeMethodAccessorImpl.invoke ( nativemethodaccessorimpl.java:62) ~[na:1.8.0_60] at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( delegatingmethodaccessorimpl.java:43) ~[na:1.8.0_60] at Java.lang.reflect.Method.invoke (method.java:497) ~[na : 1.8.0_60] at Org.springframework.boot.devtools.restart.RestartLauncher.run (restartlauncher.java:49) [ spring-boot-devtools-1.5.3.release.jar:1.5.3.release]caused by:javax.persistence.PersistenceException: [ Persistenceunit:default] Unable to build Hibernate sessionfactory at Org.hibernate.jpa.boot.internal.EntityManagerFac Torybuilderimpl.persistenceexception (entitymanagerfactorybuilderimpl.java:954) ~[Hibernate-entitymanager-5.0.12.final.jar:5.0.12.final] At Org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build (entitymanagerfactorybuilderimpl.java:882 ) ~[hibernate-entitymanager-5.0.12.final.jar:5.0.12.final] at Org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory ( SPRINGHIBERNATEJPAPERSISTENCEPROVIDER.JAVA:60) ~[spring-orm-4.3.8.release.jar:4.3.8.release] at Org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory ( localcontainerentitymanagerfactorybean.java:353) ~[spring-orm-4.3.8.release.jar:4.3.8.release] at Org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory ( abstractentitymanagerfactorybean.java:370) ~[spring-orm-4.3.8.release.jar:4.3.8.release] at Org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet ( abstractentitymanagerfactorybean.java:359) ~[spring-orm-4.3.8.release.jar:4.3.8.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( abstractautowirecapablebeanfactory.java:1687) ~[spring-beans-4.3.8.release.jar:4.3.8.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1624) ~[spring-beans-4.3.8.release.jar:4.3.8.release] ... Common frames omittedcaused by:org.hibernate.tool.schema.spi.SchemaManagementException:Unable to open JDBC Connection for schema management target at Org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare ( targetdatabaseimpl.java:42) ~[hibernate-core-5.0.12.final.jar:5.0.12.final] at Org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration (schemamigratorimpl.java:57) ~[ Hibernate-core-5.0.12.final.jar:5.0.12.final] at Org.hibernate.tool.hbm2ddl.SchemaUpdate.execute ( schemaupdate.java:134) ~[hibernate-core-5.0.12.final.jar:5.0.12.final] at Org.hibernate.tool.hbm2ddl.ScHemaupdate.execute (schemaupdate.java:101) ~[hibernate-core-5.0.12.final.jar:5.0.12.final] at Org.hibernate.internal.SessionFactoryImpl.<Init>(sessionfactoryimpl.java:472) ~[hibernate-core-5.0.12.final.jar:5.0.12.final] at Org.hibernate.boot.internal.SessionFactoryBuilderImpl.build (sessionfactorybuilderimpl.java:444) ~[ Hibernate-core-5.0.12.final.jar:5.0.12.final] At Org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build (entitymanagerfactorybuilderimpl.java:879 ) ~[hibernate-entitymanager-5.0.12.final.jar:5.0.12.final] ... Common frames omittedcaused By:java.sql.SQLNonTransientConnectionException:CLIENT_PLUGIN_AUTH is required At Com.mysql.cj.jdbc.exceptions.SQLError.createSQLException (sqlerror.java:526) ~[mysql-connector-java-6.0.6.jar : 6.0.6] at Com.mysql.cj.jdbc.exceptions.SQLError.createSQLException (sqlerror.java:513) ~[ mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.jdbc.exceptions.SQLError.createSQLException (Sqlerror.java : 505) ~[mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.jdbc.exceptions.SQLError.createSQLException ( sqlerror.java:479) ~[mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.jdbc.exceptions.SQLError.createSQLException (sqlerror.java:489) ~[mysql-connector-java-6.0.6.jar : 6.0.6] At Com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException (sqlexceptionsmapping.java:72) ~[ mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.jdbc.ConnectionImpl.createNewIO (connectionimpl.java:1606) ~ [mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.jdbc.ConnectionImpl.<Init> (connectionimpl.java:633) ~[mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.jdbc.ConnectionImpl.getInstance (connectionimpl.java:347) ~[mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.jdbc.NonRegisteringDriver.connect (nonregisteringdriver.java:219) ~[mysql-connector-java-6.0.6.jar : 6.0.6] at Org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver (pooledconnection.java:310) ~[ Tomcat-jdbc-8.5.14.jar:na] at Org.apache.tomcat.jdbc.pool.PooledConnection.connect (pooledconnection.java:203) ~[ Tomcat-jdbc-8.5.14.jar:na] at Org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection (Connectionpool.java : 735) ~[tomcat-jdbc-8.5.14.jar:na] at Org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection ( connectionpool.java:667) ~[tomcat-jdbc-8.5.14.jar:na] at Org.apache.tomcat.jdbc.pool.ConnectionPool.init ( connectionpool.java:482) ~[tomcat-jdbc-8.5.14.jar:na] at Org.apache.tomcat.jdbc.pool.ConnectionPool. <Init>(connectionpool.java:154) ~[tomcat-jdbc-8.5.14.jar:na] at Org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool (datasourceproxy.java:118) ~[tomcat-jdbc-8.5.14.jar:na] at Org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool (datasourceproxy.java:107) ~[tomcat-jdbc-8.5.14.jar:na] at Org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection (datasourceproxy.java:131) ~[tomcat-jdbc-8.5.14.jar:na ] at Org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection ( datasourceconnectionproviderimpl.java:122) ~[hibernate-core-5.0.12.final.jar:5.0.12.final] at org.hibernate.engine.jdbc.env.internal.jdbcenvironmentinitiator$ Connectionproviderjdbcconnectionaccess.obtainconnection (jdbcenvironmentinitiator.java:180) ~[ Hibernate-core-5.0.12.final.jar:5.0.12.final] at Org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare ( targetdatabaseimpl.java:38) ~[hibernate-core-5.0.12.final.jar:5.0.12.final] ... Common Frames omittedcaused By:com.mysQl.cj.core.exceptions.UnableToConnectException:CLIENT_PLUGIN_AUTH is required at Sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) ~[na:1.8.0_60] at Sun.reflect.NativeConstructorAccessorImpl.newInstance (nativeconstructoraccessorimpl.java:62) ~[na:1.8.0_60] at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance (delegatingconstructoraccessorimpl.java:45) ~[na:1.8.0 _60] at Java.lang.reflect.Constructor.newInstance (constructor.java:422) ~[na:1.8.0_60] at Com.mysql.cj.core.excepti Ons. Exceptionfactory.createexception (exceptionfactory.java:54) ~[mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.core.exceptions.ExceptionFactory.createException (exceptionfactory.java:73) ~[ mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.mysqla.io.MysqlaProtocol.rejectConnection ( mysqlaprotocol.java:327) ~[mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.mysqla.authentication.MysqlaAuthenticationProvider.connect (mysqlaauthenticationprovider.java:207) ~[mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.mysqla.io.MysqlaProtocol.connect (Mysqlaprotocol.java : 1414) ~[mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.mysqla.MysqlaSession.connect (Mysqlasession.java : ~[mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly ( connectionimpl.java:1726) ~[mysql-connector-java-6.0.6.jar:6.0.6] at Com.mysql.cj.jdbc.ConnectionImpl.createNewIO (connectionimpl.java:1596) ~[mysql-connector-java-6.0.6.jar:6.0.6] ... Common frames omitted
Problem Solving: This is due to the problem of the version of the MySQL jar package that is used in the project, change the 6.x to 5.x.
Spring boot Connection MySQL database problem resolution