Contents
  1. 1. Common Use
    1. 1.1. Character Encoding
    2. 1.2. Data Processing
    3. 1.3. Time Zone
    4. 1.4. Connection
  2. 2. Others
    1. 2.1. Timeout
  3. 3. References

Common Use

Character Encoding

1
2
useUnicode=true
characterEncoding=utf8

Data Processing

1
zeroDateTimeBehavior=convertToNull
1
tinyInt1isBit=false

Time Zone

1
serverTimezone=GMT%2B8

Connection

useSSL

For 8.0.12 and earlier: Use SSL when communicating with the server (true/false), default is ‘true’ when connecting to MySQL 5.5.45+, 5.6.26+ or 5.7.6+, otherwise default is ‘false’.

For 8.0.13 and later: Default is ‘true’. DEPRECATED. See sslMode property description for details.

  • Default Value: true
  • Since Version: 3.0.2

autoReconnect

Should the driver try to re-establish stale and/or dead connections

  • Default Value: false
  • Since Version: 1.1

maxReconnects

Maximum number of reconnects to attempt if autoReconnect is true, default is ‘3’.

1
2
useSSL=true
autoReconnect=true

Others

Timeout

initialTimeout

If autoReconnect is enabled, the initial time to wait between re-connect attempts (in seconds, defaults to ‘2’).

  • Default Value: 2
  • Since Version: 1.1

connectTimeout

Timeout for socket connect (in milliseconds), with 0 being no timeout. Only works on JDK-1.4 or newer. Defaults to ‘0’.

  • Default Value: 0
  • Since Version: 3.0.1

socketTimeout

Timeout (in milliseconds) on network socket operations (0, the default means no timeout).

  • Default Value: 0
  • Since Version: 3.0.1

References

[1] MySQL Connector/J 8.0 Configuration Properties

Contents
  1. 1. Common Use
    1. 1.1. Character Encoding
    2. 1.2. Data Processing
    3. 1.3. Time Zone
    4. 1.4. Connection
  2. 2. Others
    1. 2.1. Timeout
  3. 3. References