"User",
"Password",
"Database",
+ "Port",
+ "Socket",
NULL
};
-static int config_keys_num = 4;
+static int config_keys_num = 6;
static char *host = "localhost";
static char *user;
static char *pass;
static char *db = NULL;
+static char *socket = NULL;
+static int port = 0;
static MYSQL *getconnection (void)
{
return (NULL);
}
- if (mysql_real_connect (con, host, user, pass, db, 0, NULL, 0) == NULL)
+ if (mysql_real_connect (con, host, user, pass, db, port, socket, 0) == NULL)
{
ERROR ("mysql_real_connect failed: %s", mysql_error (con));
state = 0;
return ((pass = strdup (value)) == NULL ? 1 : 0);
else if (strcasecmp (key, "database") == 0)
return ((db = strdup (value)) == NULL ? 1 : 0);
+ else if (strcasecmp (key, "socket") == 0)
+ return ((socket = strdup (value)) == NULL ? 1 : 0);
+ else if (strcasecmp (key, "port") == 0)
+ return ((port = atoi (value)) == NULL ? 1 : 0);
else
return (-1);
}