Skip to content

config_files

Georg Richter edited this page Oct 8, 2021 · 4 revisions

Configuration files

By default MariaDB Connector/C doesn't read any configuration file, this needs to be forced either by setting the option MYSQL_READ_DEFAULT_FILE or MYSQL_READ_DEFAULT_GROUP:

/* process options from a configuration file which is not in standard place */
rc= mysql_options(mysql, MYSQL_READ_DEFAULT_FILE, "/home/jeff/config/my_config.cnf");

/* Only process options from group my_app */
rc= mysql_options(mysql, MYSQL_READ_DEFAULT_GROUP, "my_app"`);

Default location of configuration files

If a group (or an empty group) was specified, MariaDB Connector/C looks for configuration files in the following locations:

Windows

  1. System windows directory
  2. System directory
  3. Windows directory
  4. C:\
  5. MARIADB_HOME environment variable

Posix/Linux

  1. SYSCONFDIR (if Connector/C was build with server package)
  2. /etc/
  3. /etc/mysql
  4. MARIADB_HOME environment variable
  5. .my.cnf in home directory of the current user

Default groups

In addition to the specified group MariaDB Connector/C will process options from the following groups:

  1. [client]
  2. [client-server]
  3. [client-mariadb]
  4. [group] (if specified via mysql_options)

Configuration options

Clone this wiki locally