Setting server options


There are many options you might set for a MariaDB database. These options may be specified as part of the JDBC connection string simply by prefixing each server option with server.. The following example sets two driver parameters and two server parameters:

 String url = 'jdbc:mysql://' + hostColonPort + '/'
 + '?'
 + 'cacheServerConfiguration=true'
 + '&'
 + 'useLocalSessionState=true'
 + '&'
 + 'server.basedir=/opt/myapp/db'
 + '&'
 + 'server.datadir=/mnt/bigdisk/myapp/data';

Starting with Connector/MXJ 5.0.6, you can use the initialize-user property to a connection string. If set to true, the default anonymous and root users will be removed and the user/password combination from the connection URL will be used to create a new user. For example:

Retornar