Spring Boot:Unable to open JDBC connection for schema management target
2017-06-27 16:45
666 查看
启动Spring Boot工程时出现了这个错误,表示无法建立JDBC连接,肯定首先是想到数据库的连接出了问题,Spring Boot在启动时会检查数据库的连接是否正常,所以在这里会报错,这里使用了Mysql数据源,配置信息:
发现用户名和密码都正常,去MYSQL下查看,居然是没有数据库test的问题。所以只需要新建test数据库即可:
这里出现的问题一定是在JDBC的连接上,所以对症下药,检查数据库的配置信息,可能是用户名密码不匹配啊,数据库链接写得不对啊,或者数据库没有启动啊,都是有可能的。
# MYSQL DATASOURCE CONFIG spring.datasource.url=jdbc:mysql://localhost:3306/test spring.datasource.username=root spring.datasource.password=root spring.datasource.driverClassName=com.mysql.jdbc.Driver spring.jpa.database=MYSQL spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=update spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
发现用户名和密码都正常,去MYSQL下查看,居然是没有数据库test的问题。所以只需要新建test数据库即可:
CREATE DATABASE IF NOT EXISTS test DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
这里出现的问题一定是在JDBC的连接上,所以对症下药,检查数据库的配置信息,可能是用户名密码不匹配啊,数据库链接写得不对啊,或者数据库没有启动啊,都是有可能的。
相关文章推荐
- 17-10-31_Unable to execute schema management to JDBC target异常
- Unable to open a connection to the libvirt management daemon
- Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/sc
- onfiguration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security]
- spring报错Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace
- Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/sc
- Unable to locate Spring NamespaceHandler for XML schema namespace异常
- Unable to locate Spring NamespaceHandler for XML schema namespace 【http://www.springframework.org/schema/context】
- Unable to locate Spring NamespaceHandler for XML schema namespace
- Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/s
- spring 与 CXF 整合 webservice 出现error “Unable to locate Spring NamespaceHandler for XML schema namespace” 总结
- Unable to locate Spring NamespaceHandler for XML schema namespace异常解决
- Unable to get managed connection for jdbc
- Hive 笔记异常(java.sql.SQLException: Unable to open a test connection to the given database. JDBC url =)
- Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/sc
- Spring 3.0: Unable to locate Spring NamespaceHandler for XML schema namespace
- Unable to locate Spring NamespaceHandler for XML schema namespace
- Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/sc
- transaction 用tx事务 测试时 报错:Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/mvc]
- Unable to open a test connection to the given database. JDBC url =