首页 新闻 会员 周边 捐助

数据库连接不上

0
[已解决问题] 解决于 2020-06-09 07:37

2020-04-13 23:51:29,949 [Druid-ConnectionPool-Create-884713463] ERROR [com.alibaba.druid.pool.DruidDataSource] - create connection error, url: jdbc:mysql://localhost:3306/db_blog?useUnicode=true&characterEncoding=UTF-8
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3870)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3806)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1686)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1207)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2254)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2285)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2084)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:795)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)
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.jdbc.Util.handleNewInstance(Util.java:404)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:327)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1386)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1442)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1881)


这个都正确 用Navicat也是可以连接的

dev-pan的主页 dev-pan | 菜鸟二级 | 园豆:212
提问于:2020-04-14 00:16
< >
分享
最佳答案
0

url: jdbc:mysql://localhost:3306/db_blog?useUnicode=true&characterEncoding=UTF-8

数据库不一样

奖励园豆:5
江云风 | 小虾三级 |园豆:889 | 2020-04-14 13:27
其他回答(2)
0

Navicat输密码重连一次,看是不是密码错了

困难户 | 园豆:168 (初学一级) | 2020-04-14 00:27

不是 估计是eclipse的配置太乱了 重新换了个编辑器能运行了 ,我一开始怀疑是微屁恩导致我的hosts文件出错了,然后换了工具直接可以运行了!现在在调试IDEA,看是否出错

支持(0) 反对(0) dev-pan | 园豆:212 (菜鸟二级) | 2020-04-14 00:53
0

切换新的IDE编辑工具

dev-pan | 园豆:212 (菜鸟二级) | 2020-04-14 00:36
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册