Category Archives: MySQL

MySQL server has gone away Error [How to Solve]

Reference: solution to MySQL server has gone away error – time blog
When we use Mysql to import large file SQL, we may report the MySQL server has gone away error. The problem is the default value setting of  max_allowed_packet configuration is too small. You only need to increase the value of this item and import it again to succeed. This item is used to limit the size of the package received by the MySQL server. Therefore, if the imported file is too large, it may exceed the value set in this item, resulting in unsuccessful import! Let’s take a look at how to view and set the value of this item.

View the value of Max_allowed_packet

show global variables like 'max_allowed_packet';


+--------------------+---------+
| Variable_name      | Value   |
+--------------------+---------+
| max_allowed_packet | 4194304 |
+--------------------+---------+

You can see that the size of this item is only 4m by default. Next, set the value to 150m (1024 * 1024 * 150)

set global max_allowed_packet=157286400;

View the size again

show global variables like 'max_allowed_packet';

By increasing this value, generally speaking, importing SQL with a large amount of data should be successful again. If an error is still reported, continue to increase it. Please note that setting in the command line is only valid for the current time. After restarting the MySQL service, restore the default value, but you can modify the configuration file (you can add max_allowed_packet = 150m in the configuration file my.cnf) To achieve the purpose of permanent validity, but in fact, we do not often import such a large amount of data, so I think the current configuration can take effect through the command, and there is no need to modify the configuration file.

Oracle Database AWR error: ORA-06502 [How to Solve]

Oracle database AWR report is an important tool for DBA to analyze database performance!

Recently encountered a problem and reported an error:

ERROR:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 919
ORA-06512: at line 1

So, how to solve this problem?

Solution:

update WRH$_SQLTEXT set sql_text = SUBSTR(sql_text, 1, 1000);
commit;

After execution, re execute sqlplus/as SYSDBA @/ RDMBS/admin/awrrpt. SQL script successfully generates AWR report!


This sharing is over~

[Solved] Error: read ECONNRESET at TCP.onStreamRead Cannot enqueue Query after fatal error

Error analysis

This error often occurs when I use node to connect to MySQL. I wonder if it is because I do not close the connection every time I query the database after creating a MySQL connection, so the database is always connected and does not respond for a long time, resulting in the following error
error1:

error2:

 

Solution:

error1:

const mysql = require('mysql');
const connInfo = require('./config');

function queryMysql(sql, callback){
    const conn = mysql.createConnection(connInfo)
    conn.query(sql, (err, result)=>{
        if(err){
            console.log(err);
        }else {
            callback(result)
        }
        conn.end(err => {
            if(err){
                console.log(err)
            }
        })
    })
}

module.exports = queryMysql;

Error2:
We only need to configure useConnectionPooling true when instantiating SessionStore for example:

var sessionStore = new SessionStore({
    host: 'localhost' ,
    port: 3306 ,
    user: 'root' ,
    password: 'root' ,
    database: 'session' ,
    useConnectionPooling: true 
});

[Solved] PostgreSQL enumeration type usage error: operator does not exist error handling

//Creating Enumeration Classes
CREATE TYPE USER_ROLE AS ENUM ('MALE', 'FEMALE');
//Add conversion rules
CREATE CAST (VARCHAR AS USER_ROLE) WITH INOUT AS IMPLICIT;
//Create table, add fields of enumeration type
create table sys_user
(
    row_id      bigserial          not null
        constraint sys_user_pkey primary key,
    create_time timestamp(6),
    update_time timestamp(6),
    del_flag    smallint default 0 not null,
    role        USER_ROLE      not null,
    user_name   varchar(200)       not null
);

Because the conversion rule is added, you can directly use the varchar type string as the judgment condition query in pgadmin, but if you use mybatis to query the database, the error operator does not exist will be reported

select * from sys_user where del_flag = 0 and role = 'MALE'

Solution: convert varchar type to enumeration type and compare

Method 1
select * from sys_user where del_flag = 0 and role = cast(#{role} as user_role);
Method 2
select * from sys_user where del_flag = 0 and role = #{role}::user_role;

[Solved] MYSQL Error: unknown error 1130, unknown error 1045

When using Navicat to link mysql, the following error is reported:

Solution:

Log in to MySQL on the server and enter use MySQL:

[email protected] 09:07:  [mysql]> update user set host = '%' where user = 'root';
Query OK, 1 row affected (0.07 sec)
[email protected] 09:12:  [mysql]> flush privileges;
Query OK, 0 rows affected (0.02 sec)

Then, using the Navicat link again, the following appears:

Solution:

GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘yourpassword’ WITH GRANT OPTION

[email protected] 09:13:  [mysql]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
Query OK, 0 rows affected, 1 warning (0.02 sec)

[email protected] 09:14:  [mysql]> flush privileges;
Query OK, 0 rows affected (0.02 sec)

To sum up: this kind of error is probably caused by the permissions set by the root user in MySQL in the database

[Solved Perfectly] MySQL ERROR 1064 (42000): You have an error in your SQL syntax;

The perfect solution to error 1064

1064 error code appears when setting the root account password in MySQL

at first, I thought the user name and password could not be the same, so I changed it to 123456

and found it still couldn’t.

Solution

Enter as follows:

alter user 'root'@localhost identified by '123456';

By ‘…’ is followed by the new password.

[Solved] Navicat connection error 1251 compatibility with docker MySQL

# Modify the encryption rules
(1) ALTER USER ‘root’@’%’ IDENTIFIED BY ‘password’ PASSWORD EXPIRE NEVER;
# Update the user’s password
(2) ALTER USER ‘root’@’%’ IDENTIFIED WITH mysql_native_password BY ‘password’;
# Refresh permissions
(3)FLUSH PRIVILEGES;
reconnect the Navicat will solve the problem.

Mysql8.02/ubuntu 20 ERROR 1449 (HY000) [How to Solve]

Just after installing MySQL through apt install MySQL server, I encountered a pit. After checking for a long time, I finally found the answer. Thank you, netizens.

mysql> show databases;
ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist

If you enter mysql, you will report an error. I don’t know why. Confused B

mysql> create user ' mysql.infoschema '@'% 'identified by' password ';
Query OK, 0 rows affected (0.01 sec)
mysql> grant all privileges on *.* to 'mysql.infoschema'@'%';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

Mybatis Error setting non null for parameter #15 with JdbcType null Could not set parameters for

Caused by: org.apache.ibatis.type.TypeException: Error setting non null for parameter #15 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (15 > number of parameters, which is 14).
	at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:71)
	at com.baomidou.mybatisplus.core.MybatisDefaultParameterHandler.setParameters(MybatisDefaultParameterHandler.java:227)
	... 88 more
Caused by: java.sql.SQLException: Parameter index out of range (15 > number of parameters, which is 14).

If a comment SQL fragment exists in the SQL code, the #{} parameter cannot be used in the comment SQL fragment. As follows:

        on t1.dealer_code = t4.dealer_code
        -- left join (
        --     select
        --         ads_code
        --        ,sum(case when car like '%MM%' or model = 'MM' then ss_num else 0 end) as ws_MM_num
        --     from abc_assss_ss
        --     where seq = 1 and count_date between '2021-04-01' and '2021-06-30'
        --     group by
        --         dealer_code
        --     )t2
        -- on t1.asd_code = t2.ads_code
        )
        select
      ~~~
      If you replace the between and with the parameter between #{start_time} and #{end_time}, it will report this error, hope it can solve your problem

IDEA maven Config MYSQL Connection Error: Could not create connection to database server.

Error message

2021.2\lib\idea_rt.jar;E:\IDEA\IDEA\IntelliJ IDEA 2021.2\plugins\junit\lib\junit5-rt.jar;E:\IDEA\IDEA\IntelliJ IDEA 2021.2\plugins\junit\lib\junit-rt.jar;E:\JDK1.8.301\jre\lib\charsets.jar;E:\JDK1.8.301\jre\lib\deploy.jar;E:\JDK1.8.301\jre\lib\ext\access-bridge-64.jar;E:\JDK1.8.301\jre\lib\ext\cldrdata.jar;E:\JDK1.8.301\jre\lib\ext\dnsns.jar;E:\JDK1.8.301\jre\lib\ext\jaccess.jar;E:\JDK1.8.301\jre\lib\ext\jfxrt.jar;E:\JDK1.8.301\jre\lib\ext\localedata.jar;E:\JDK1.8.301\jre\lib\ext\nashorn.jar;E:\JDK1.8.301\jre\lib\ext\sunec.jar;E:\JDK1.8.301\jre\lib\ext\sunjce_provider.jar;E:\JDK1.8.301\jre\lib\ext\sunmscapi.jar;E:\JDK1.8.301\jre\lib\ext\sunpkcs11.jar;E:\JDK1.8.301\jre\lib\ext\zipfs.jar;E:\JDK1.8.301\jre\lib\javaws.jar;E:\JDK1.8.301\jre\lib\jce.jar;E:\JDK1.8.301\jre\lib\jfr.jar;E:\JDK1.8.301\jre\lib\jfxswt.jar;E:\JDK1.8.301\jre\lib\jsse.jar;E:\JDK1.8.301\jre\lib\management-agent.jar;E:\JDK1.8.301\jre\lib\plugin.jar;E:\JDK1.8.301\jre\lib\resources.jar;E:\JDK1.8.301\jre\lib\rt.jar;C:\Users\13288\Desktop\heiMaProject\springIOC_Anno20210824\target\test-classes;C:\Users\13288\.m2\repository\mysql\mysql-connector-java\5.1.32\mysql-connector-java-5.1.32.jar;C:\Users\13288\.m2\repository\junit\junit\4.11\junit-4.11.jar;C:\Users\13288\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;C:\Users\13288\.m2\repository\com\alibaba\druid\1.1.10\druid-1.1.10.jar;C:\Users\13288\.m2\repository\c3p0\c3p0\0.9.1.2\c3p0-0.9.1.2.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 com.sadhu.config.DataSourseConfiguration,test1
八月 24, 2021 5:19:38 下午 com.mchange.v2.log.MLog <clinit>
信息: MLog clients using java 1.4+ standard logging.
八月 24, 2021 5:19:39 下午 com.mchange.v2.c3p0.C3P0Registry banner
信息: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug?true; trace: 10]
八月 24, 2021 5:19:39 下午 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 31snbdajx58efk1sewirk|379619aa, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> null, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 31snbdajx58efk1sewirk|379619aa, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:33061, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
八月 24, 2021 5:20:09 下午 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run
警告: [email protected]a6 -- 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.MySQLNonTransientConnectionException: Could not create connection to database server.
	at sun.reflect.GeneratedConstructorAccessor6.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:408)
	at com.mysql.jdbc.Util.getInstance(Util.java:383)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1023)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:997)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:983)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:928)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2576)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2309)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
	at sun.reflect.GeneratedConstructorAccessor7.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:408)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:419)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:344)
	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)
Caused by: java.lang.NullPointerException
	at com.mysql.jdbc.ConnectionImpl.getServerCharset(ConnectionImpl.java:3299)
	at com.mysql.jdbc.MysqlIO.sendConnectionAttributes(MysqlIO.java:1967)
	at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1893)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1287)
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2494)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2527)
	... 17 more

八月 24, 2021 5:20:09 下午 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run
警告: [email protected]db -- 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.MySQLNonTransientConnectionException: Could not create connection to database server.
	at sun.reflect.GeneratedConstructorAccessor6.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:408)
	at com.mysql.jdbc.Util.getInstance(Util.java:383)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1023)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:997)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:983)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:928)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2576)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2309)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
	at sun.reflect.GeneratedConstructorAccessor7.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:408)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:419)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:344)
	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)
Caused by: java.lang.NullPointerException
	at com.mysql.jdbc.ConnectionImpl.getServerCharset(ConnectionImpl.java:3299)
	at com.mysql.jdbc.MysqlIO.sendConnectionAttributes(MysqlIO.java:1967)
	at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1893)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1287)
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2494)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2527)
	... 17 more

八月 24, 2021 5:20:09 下午 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run
警告: [email protected]4d -- 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.MySQLNonTransientConnectionException: Could not create connection to database server.
	at sun.reflect.GeneratedConstructorAccessor6.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:408)
	at com.mysql.jdbc.Util.getInstance(Util.java:383)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1023)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:997)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:983)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:928)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2576)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2309)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
	at sun.reflect.GeneratedConstructorAccessor7.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:408)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:419)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:344)
	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)
Caused by: java.lang.NullPointerException
	at com.mysql.jdbc.ConnectionImpl.getServerCharset(ConnectionImpl.java:3299)
	at com.mysql.jdbc.MysqlIO.sendConnectionAttributes(MysqlIO.java:1967)
	at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1893)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1287)
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2494)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2527)
	... 17 more


java.sql.SQLException: Connections could not be acquired from the underlying database!

	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
	at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
	at com.sadhu.config.DataSourseConfiguration.test1(DataSourseConfiguration.java:17)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
	at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
	at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
	at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
	... 24 more


Process finished with exit code -1

 

reason

The package version of the connection data is too low

Solution:

You can use a higher version

after modification, you can pass