aboutsummaryrefslogtreecommitdiff
path: root/src/sql.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql.c')
-rw-r--r--src/sql.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sql.c b/src/sql.c
index 4b1a02b..e758b0c 100644
--- a/src/sql.c
+++ b/src/sql.c
@@ -10,10 +10,16 @@ MYSQL_RES *result;
void
sql_connect()
{
+ char *socket_path = NULL;
+
+ if (sql_host[0] == '/') {
+ socket_path = sql_host;
+ sql_host = "localhost";
+ }
if (!mysql_real_connect(&mysql,
sql_host, sql_user,
sql_password, sql_database, sql_port,
- NULL, 0)) {
+ socket_path, 0)) {
fprintf(stderr,
"cannot connect to MySQL server: %s\n",
mysql_error(&mysql));

Return to:

Send suggestions and report system problems to the System administrator.