MySql link error prompt: Unknown character set: 'utf8mb4'

警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@50002a2 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown character set: 'utf8mb4'

at sun.reflect.GeneratedConstructorAccessor23.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:400)

at com.mysql.jdbc.Util.getInstance(Util.java:383)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:980)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2541)

at com.mysql.jdbc.ConnectionImpl.configureClientCharacterSet(ConnectionImpl.java:1824)

at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3374)

at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2293)

at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2079)

at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)

at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)

at sun.reflect.GeneratedConstructorAccessor19.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:400)

at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)

at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:146)

at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:195)

at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:184)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200)

at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire (BasicResourcePool.java:1086)

at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess (BasicResourcePool.java:1073)

at com.mchange.v2.resourcepool.BasicResourcePool.access $ 800 (BasicResourcePool.java:44)

at com.mchange.v2.resourcepool.BasicResourcePool $ ScatteredAcquireTask.run (BasicResourcePool.java:1810)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648)

 

 

When tomcat starts the project, the error prompt of the above information is prompted. Through direct analysis, it is suspected that it is the encoding problem of the database, but after checking the encoding, it is found that the prompt cannot be modified.

Searched a lot from the Internet and finally solved it.

It turned out to be a problem caused by a mismatch between the database and the link driver.

The database is mySql 6.1.xxx, and the driver is configured in pom.xml, which is 5.1.26, and the two do not match.

Replace the database, the problem is solved.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326688107&siteId=291194637