summaryrefslogtreecommitdiffabout
path: root/src/sql.c
Side-by-side diff
Diffstat (limited to 'src/sql.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/sql.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sql.c b/src/sql.c
index 0ccc2e7..a4b311e 100644
--- a/src/sql.c
+++ b/src/sql.c
@@ -70,12 +70,20 @@ sql_init_dictionary (struct dictionary *dict)
if (conn->initcount++ == 0)
{
mysql_init (&conn->mysql);
+
+ if (conn->config_file)
+ mysql_options (&conn->mysql, MYSQL_READ_DEFAULT_FILE,
+ conn->config_file);
+ if (conn->config_group)
+ mysql_options (&conn->mysql, MYSQL_READ_DEFAULT_GROUP,
+ conn->config_group);
+
if (conn->cacert)
mysql_ssl_set (&conn->mysql, NULL, NULL, conn->cacert,
NULL, NULL);
if (!mysql_real_connect (&conn->mysql, conn->host, conn->user,
conn->password, conn->database, conn->port,
- conn->socket, 0))
+ conn->socket, CLIENT_MULTI_RESULTS))
{
logmsg (LOG_ERR, _("failed to connect to database %s: error: %s\n"),
dict->parmv[0], mysql_error (&conn->mysql));

Return to:

Send suggestions and report system problems to the System administrator.