首页 > 数据库技术 > 详细

Access denied for user 'GC'@'localhost' (using password: YES)

时间:2021-03-28 22:05:52      阅读:31      评论:0      收藏:0      [点我收藏+]

 

错误描述:使用的是C3P0连接池  

     Spring整合Mybatis时出现错误

java.sql.SQLException: Access denied for user ‘GC‘@‘localhost‘ (using password: YES)
DEBUG [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] - An exception occurred while acquiring a poolable resource. Will retry.
java.sql.SQLException: Access denied for user ‘GC‘@‘localhost‘ (using password: YES)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835)
    at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)
    at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
    at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
    at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
    at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
    at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
    at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

Process finished with exit code -1

问题解决:下图中的username、password 改为name、pwd (其实只修改username就可以 为了后面不出问题最好俩个都修改)

技术分享图片

 

技术分享图片

 

 

 

 

 注意:我的错误是因为没有按照C3P0连接池的格式  (这个问题也可能是数据库密码错误)

 

Access denied for user 'GC'@'localhost' (using password: YES)

原文:https://www.cnblogs.com/peng-1234/p/14589337.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!