aboutsummaryrefslogtreecommitdiff
path: root/src/sql.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql.c')
-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)
70 if (conn->initcount++ == 0) 70 if (conn->initcount++ == 0)
71 { 71 {
72 mysql_init (&conn->mysql); 72 mysql_init (&conn->mysql);
73
74 if (conn->config_file)
75 mysql_options (&conn->mysql, MYSQL_READ_DEFAULT_FILE,
76 conn->config_file);
77 if (conn->config_group)
78 mysql_options (&conn->mysql, MYSQL_READ_DEFAULT_GROUP,
79 conn->config_group);
80
73 if (conn->cacert) 81 if (conn->cacert)
74 mysql_ssl_set (&conn->mysql, NULL, NULL, conn->cacert, 82 mysql_ssl_set (&conn->mysql, NULL, NULL, conn->cacert,
75 NULL, NULL); 83 NULL, NULL);
76 if (!mysql_real_connect (&conn->mysql, conn->host, conn->user, 84 if (!mysql_real_connect (&conn->mysql, conn->host, conn->user,
77 conn->password, conn->database, conn->port, 85 conn->password, conn->database, conn->port,
78 conn->socket, 0)) 86 conn->socket, CLIENT_MULTI_RESULTS))
79 { 87 {
80 logmsg (LOG_ERR, _("failed to connect to database %s: error: %s\n"), 88 logmsg (LOG_ERR, _("failed to connect to database %s: error: %s\n"),
81 dict->parmv[0], mysql_error (&conn->mysql)); 89 dict->parmv[0], mysql_error (&conn->mysql));

Return to:

Send suggestions and report system problems to the System administrator.