-
Notifications
You must be signed in to change notification settings - Fork 256
config_files
Georg Richter edited this page Oct 8, 2021
·
4 revisions
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"`);
If a group (or an empty group) was specified, MariaDB Connector/C looks for configuration files in the following locations:
- System windows directory
- System directory
- Windows directory
- C:\
- MARIADB_HOME environment variable
- SYSCONFDIR (if Connector/C was build with server package)
- /etc/
- /etc/mysql
- MARIADB_HOME environment variable
- .my.cnf in home directory of the current user
In addition to the specified group MariaDB Connector/C will process options from the following groups:
- [client]
- [client-server]
- [client-mariadb]
- [group] (if specified via mysql_options)
MariaDB Connector/C Reference