MySQL Connector/J 8.0 Developer Guide

6.3 Configuration Properties

Configuration properties define how Connector/J will make a connection to a MySQL server. Unless otherwise noted, properties can be set for a DataSource object or for a Connection object.

Configuration properties can be set in one of the following ways:

The properties are listed by categories in the following tables and then in the subsections that follow. Click on a property name in the tables to see its full description in the subsections.

Table 6.1 Authentication Properties

Name Default Value Since Version
user - all versions
password - all versions
password1 - 8.0.28
password2 - 8.0.28
password3 - 8.0.28
authenticationPlugins - 5.1.19
disabledAuthenticationPlugins - 5.1.19
ociConfigFile - 8.0.27
defaultAuthenticationPlugin mysql_native_password 5.1.19
ociConfigProfile DEFAULT 8.0.33
authenticationFidoCallbackHandler - 8.0.29
ldapServerHostname - 8.0.23

Table 6.2 Connection Properties

Name Default Value Since Version
connectionAttributes - 5.1.25
connectionLifecycleInterceptors - 5.1.4
useConfigs - 3.1.5
clientInfoProvider com.mysql.cj.jdbc.CommentClientInfoProvider 5.1.0
createDatabaseIfNotExist false 3.1.9
databaseTerm CATALOG 8.0.17
detectCustomCollations false 5.1.29
disconnectOnExpiredPasswords true 5.1.23
interactiveClient false 3.1.0
passwordCharacterEncoding - 5.1.7
propertiesTransform - 3.1.4
rollbackOnPooledClose true 3.0.15
useAffectedRows false 5.1.7

Table 6.3 Session Properties

Name Default Value Since Version
sessionVariables - 3.1.8
characterEncoding - 1.1g
characterSetResults - 3.0.13
connectionCollation - 3.0.13
customCharsetMapping - 8.0.26
trackSessionState false 8.0.26

Table 6.4 Networking Properties

Name Default Value Since Version
socksProxyHost - 5.1.34
socksProxyPort 1080 5.1.34
socketFactory com.mysql.cj.protocol.StandardSocketFactory 3.0.3
connectTimeout 0 3.0.1
socketTimeout 0 3.0.1
dnsSrv false 8.0.19
localSocketAddress - 5.0.5
maxAllowedPacket 65535 5.1.8
socksProxyRemoteDns false 8.0.29
tcpKeepAlive true 5.0.7
tcpNoDelay true 5.0.7
tcpRcvBuf 0 5.0.7
tcpSndBuf 0 5.0.7
tcpTrafficClass 0 5.0.7
useCompression false 3.0.17
useUnbufferedInput true 3.0.11

Table 6.5 Security Properties


Table 6.6 Statements Properties

Name Default Value Since Version
cacheDefaultTimeZone true 8.0.20
continueBatchOnError true 3.0.3
dontTrackOpenResources false 3.1.7
queryInterceptors - 8.0.7
queryTimeoutKillsConnection false 5.1.9

Table 6.7 Prepared Statements Properties


Table 6.8 Result Sets Properties


Table 6.9 Metadata Properties

Name Default Value Since Version
getProceduresReturnsFunctions true 5.1.26
noAccessToProcedureBodies false 5.0.3
nullDatabaseMeansCurrent false 3.1.8
useHostsInPrivileges true 3.0.2
useInformationSchema false 5.0.0

Table 6.10 BLOB/CLOB processing Properties

Name Default Value Since Version
autoDeserialize false 3.1.5
blobSendChunkSize 1048576 3.1.9
blobsAreStrings false 5.0.8
clobCharacterEncoding - 5.0.0
emulateLocators false 3.1.0
functionsNeverReturnBlobs false 5.0.8
locatorFetchBufferSize 1048576 3.2.1

Table 6.11 Datetime types processing Properties


Table 6.12 High Availability and Clustering Properties


Table 6.13 Performance Extensions Properties


Table 6.14 Debugging/Profiling Properties

Name Default Value Since Version
logger com.mysql.cj.log.StandardLogger 3.1.1
profilerEventHandler com.mysql.cj.log.LoggingProfilerEventHandler 5.1.6
useNanosForElapsedTime false 5.0.7
maxQuerySizeToLog 2048 3.1.3
maxByteArrayAsHex 1024 8.0.31
profileSQL false 3.1.0
logSlowQueries false 3.1.2
slowQueryThresholdMillis 2000 3.1.2
slowQueryThresholdNanos 0 5.0.7
autoSlowLog true 5.1.4
explainSlowQueries false 3.1.2
gatherPerfMetrics false 3.1.2
reportMetricsIntervalMillis 30000 3.1.2
logXaCommands false 5.0.5
traceProtocol false 3.1.2
enablePacketDebug false 3.1.3
packetDebugBufferSize 20 3.1.3
useUsageAdvisor false 3.1.1
resultSetSizeThreshold 100 5.0.5
autoGenerateTestcaseScript false 3.1.9

Table 6.15 Exceptions/Warnings Properties


Table 6.16 Tunes for integration with other products Properties

Name Default Value Since Version
overrideSupportsIntegrityEnhancementFacility false 3.1.12
ultraDevHack false 2.0.3

Table 6.17 JDBC compliance Properties

Name Default Value Since Version
useColumnNamesInFindColumn false 5.1.7
pedantic false 3.0.0
useOldAliasMetadataBehavior false 5.0.4

Table 6.18 X Protocol and X DevAPI Properties