1. Tomcat on a running server, add a B item, and report "Access denied for user "root"@"localhost" (using password: YES)".
run locally and connect to the server"s database at the same time. Put the code on the server and report an error.
2. Tomcat"s original An event is normal, and there is no problem with local B event, so jdbc.properties is no problem.
3,
1. I thought it was the connection pool problem of c3p0, but the larger setting is not enough.
2. It should not be the mysql problem of the server. It is said on the Internet that you should enter the security mode of mysql and re-password. But it didn"t work. Because AB projects are all written in the same framework, they are all the same in configuration. In the same mysql.
3. Server environment is java1.8 tomcat8 mysql5.7 nginx1.14
IV. Code
<context:property-placeholder location="classpath:jdbc.properties"/>
<bean id="pooledDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="jdbcUrl" value="${jdbc.jdbcUrl}"></property>
<property name="driverClass" value="${jdbc.driverClass}"></property>
<property name="user" value="${jdbc.user}"></property>
<property name="password" value="${jdbc.password}"></property>
<!-- -->
< property name= "initialPoolSize" value= "${c3p0.initialPoolSize}" > < / property >
< property name= "minPoolSize" value= "${c3p0.minPoolSize}" > < / property >
< property name= "maxPoolSize" value= "${c3p0.maxPoolSize}" > < / property >
< property name= "acquireIncrement" value= "${c3p0.acquireIncrement}" > < / property >
V, error
DEBUG [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread--sharp0]-An exception occurred while acquiring a poolable resource. Will retry.
java.sql.SQLException: Access denied for user "root"@"localhost" (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException (SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException (SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket (MysqlIO.java:3536)
at com.mysql.jdbc.MysqlIO.checkErrorPacket (MysqlIO.java:3468)
at com.mysql.jdbc.MysqlIO.checkErrorPacket (MysqlIO.java:917)
at com.mysql.jdbc.MysqlIO .secureAuth411 (MysqlIO.java:3974)
at com.mysql.jdbc.MysqlIO.doHandshake (MysqlIO.java:1282)
at com.mysql.jdbc.ConnectionImpl.createNewIO (ConnectionImpl.java:2142)
at com.mysql.jdbc.ConnectionImpl. < init > (ConnectionImpl.java:773)
at com.mysql.jdbc.JDBC4Connection. < init > (JDBC4Connection.java:46)
at sun.reflect.GeneratedConstructorAccessor33.newInstance (Unknown Source)
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:406)
at com.mysql.jdbc.ConnectionImpl.getInstance (ConnectionImpl.java:352)
at com.mysql.jdbc.NonRegisteringDriver.connect (NonRegisteringDriver.java:282)
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)