diff options
-rw-r--r-- | server/mysqldb.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/server/mysqldb.c b/server/mysqldb.c index 517c15b..9ce9d96 100644 --- a/server/mysqldb.c +++ b/server/mysqldb.c @@ -58,21 +58,15 @@ mysqldb_connect_new() return NULL; } - if (!mysql_connect(dbh, config.mysql_host, - config.mysql_user, config.mysql_pass)) { + if (!mysql_real_connect(dbh, config.mysql_host, + config.mysql_user, config.mysql_pass, + db_dbn, 0, NULL, 0)) { log_err("Couldn't open connection to database: %s.", mysql_error(dbh)); mysqldb_connect_close(dbh); return NULL; } - if (mysql_select_db(dbh, db_dbn)) { - log_err("Couldn't open database: %s.", - mysql_error(dbh)); - mysqldb_connect_close(dbh); - return NULL; - } - log_info("MySQL database interface initialised."); return (void *)dbh; } |