Tag Archives: druid

Druid Error: c.a.druid.pool.DruidAbstractDataSource: discard long time none received connection.

C.a.druid.pool.druidabstractdatasource: discard long time none received connection

Make a simple record~

Many posts on the Internet say that there are about two ways to solve it:

1. Class file configuration, add configuration (invalid here)

    @PostConstruct
    public void init(){
        // discard long time none received connection
        System.setProperty("druid.mysql.usePingMethod", "false");
    }

2. The MySQL version has been adjusted accordingly (it is also invalid for me)

3. Add: – dduid.Mysql.Usepingmethod = false (valid) in the operation parameters

nohup java -Ddruid.mysql.usePingMethod=false -jar user-0.0.1-SNAPSHOT.jar --server.port=9092  >user.out &

Org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping

org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping

Reason: yml file format error, this file requires strict requirements format

If the nodes are not aligned, align the Mybatis nodes with the Spring nodes, here is the yml configuration file for SpringBoot 2.0 + Mybatis + Mysql

server:
port: 8080
spring:
datasource:
name: daducha
type: com.alibaba.druid.pool.DruidDataSource
druid:
url: jdbc:mysql://127.0.0.1:3306/daducha
username: root
password: root
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
driver-class-name: com.mysql.jdbc.Driver
mybatis:
mapper-locations: classpath:mapping/*.xml
type-aliases-package: com.wuji.entity.po