关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、418799587 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 5868|回复: 6

[环境搭建] 环境搭建好了,数据库无法连接

[复制链接]
发表于 2018-12-5 11:25:22 | 显示全部楼层 |阅读模式
数据库配置信息

#MySQL
hibernate.dialect=org.hibernate.dialect.MySQLDialect
validationQuery.sql=SELECT 1
jdbc.url.jeecg=jdbc:mysql://127.0.0.1:3306/jeecg?useUnicode=true&characterEncoding=UTF-8
jdbc.username.jeecg=root
jdbc.password.jeecg=123456
jdbc.dbType=mysql
 楼主| 发表于 2018-12-5 11:26:00 | 显示全部楼层
报错信息

[2018-12-05 11:19:35] [ERROR] [com.alibaba.druid.pool.DruidDataSource:2469] create connection SQLException, url: jdbc:mysql://127.0.0.1:3306/jeecg?useUnicode=true&characterEncoding=UTF-8, errorCode 0, state 08001
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
        at sun.reflect.GeneratedConstructorAccessor74.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2575)
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2311)
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
        at sun.reflect.GeneratedConstructorAccessor71.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
        at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:149)
        at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:218)
        at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:143)
        at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1515)
        at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1578)
        at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466)
Caused by: java.lang.NullPointerException
        at com.mysql.jdbc.ConnectionImpl.getServerCharacterEncoding(ConnectionImpl.java:3286)
        at com.mysql.jdbc.MysqlIO.sendConnectionAttributes(MysqlIO.java:1987)
        at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1913)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1290)
        at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2493)
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2526)
        ... 15 more
 楼主| 发表于 2018-12-5 11:26:03 | 显示全部楼层
报错信息

[2018-12-05 11:19:35] [ERROR] [com.alibaba.druid.pool.DruidDataSource:2469] create connection SQLException, url: jdbc:mysql://127.0.0.1:3306/jeecg?useUnicode=true&characterEncoding=UTF-8, errorCode 0, state 08001
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
        at sun.reflect.GeneratedConstructorAccessor74.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2575)
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2311)
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
        at sun.reflect.GeneratedConstructorAccessor71.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
        at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:149)
        at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:218)
        at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:143)
        at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1515)
        at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1578)
        at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466)
Caused by: java.lang.NullPointerException
        at com.mysql.jdbc.ConnectionImpl.getServerCharacterEncoding(ConnectionImpl.java:3286)
        at com.mysql.jdbc.MysqlIO.sendConnectionAttributes(MysqlIO.java:1987)
        at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1913)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1290)
        at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2493)
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2526)
        ... 15 more
 楼主| 发表于 2018-12-5 11:27:39 | 显示全部楼层
如有指教,必有厚报
 楼主| 发表于 2018-12-5 11:27:42 | 显示全部楼层
如有指教,必有厚报
发表于 2018-12-5 11:34:58 | 显示全部楼层
本地数据库创建了吗,执行初始化脚步了吗
发表于 2018-12-5 11:35:00 | 显示全部楼层
本地数据库创建了吗,执行初始化脚步了吗
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表