Set MySql link url parameters (rpm)

mysql JDBC URL format is as follows: 

jdbc: mysql: // [host: port], [host: port] ... / [database] [= parameter value 1] [2 & Parameter Name] [parameter value = 2] .. [1 Parameter Name?] . 

Few of the more important parameters commonly used: 

Parameter Description Default value is the minimum version required 
user database user name (for connecting to the database) All versions 
passWord user password (for connecting to the database) All versions 
useUnicode whether to use Unicode character set, if the parameter is set to characterEncoding gb2312 or gbk, this parameter must be set to 1.1 g of to false to true 
characterEncoding useUnicode when set to true, the specified character encoding. For example, it can be set to gb2312 or gbk false 1.1g 
when autoReconnect when the database connection is disrupted, whether to automatically reconnect? 1.1 false 
autoReconnectForPools whether to use heavy for the database connection pool even strategy 3.1.3 false 
failOverReadOnly automatically reconnect after a successful connection is set to read-only? true 3.0.12 
number maxReconnects autoReconnect set to true, the retry connection 3 1.1 
when initialTimeout autoReconnect set to true, the time interval between two reconnection, Unit: 2 1.1 seconds 
timeout connectTimeout and the database server to establish a socket connection , unit: milliseconds. 0 indicates no timeout for JDK 1.4 and later 3.0.1 0 
socketTimeout Socket operation (read and write) times out, unit: ms. 0 means never timeout 0 3.0.1 

 

 

Common parameters
Parameter Description Default value of the minimum version required
user database user name (for connecting to the database)
password user password (for connecting to the database)
useUnicode whether to use Unicode character set, if the parameter is set to characterEncoding gb2312 or gbk, this parameter value 1.1 g must be set to false to true
characterEncoding useUnicode when set to true, specifies the character encoding. For example, it can be set to gb2312 or gbk false 1.1g
when autoReconnect when the database connection is disrupted, whether to automatically reconnect? 1.1 false
autoReconnectForPools whether to use heavy for the database connection pool even strategy 3.1.3 false
failOverReadOnly automatically reconnect after a successful connection is set to read-only? true 3.0.12
number maxReconnects autoReconnect set to true, the retry connection 3 1.1
when initialTimeout autoReconnect set to true, the time interval between two reconnection, Unit: 2 1.1 seconds
timeout connectTimeout and the database server to establish a socket connection , unit: milliseconds. 0 indicates no timeout for JDK 1.4 and later 3.0.1 0
socketTimeout Socket operation (read and write) times out, unit: ms. 0 indicates no timeout 3.0.1 0
allowMultiQueries MySQL driver turns on the switch of false batch execution sql
----------------
Disclaimer: This article is CSDN blogger "weiqiangGG 'original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/weiqianggg/article/details/82884754


----------------
Disclaimer: This article is CSDN bloggers "Dreamer --001" in the original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/pengyuan1111/article/details/82924628

Guess you like

Origin www.cnblogs.com/muxi0407/p/11938415.html