summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2008-04-15 11:57:30 -0400
committerBrian Cully <github.20.shmit@spamgourmet.com>2008-04-15 11:57:30 -0400
commit078555c194fd992a2e02e98f20645b82ce1792d3 (patch)
treeeb428867a52e5c9be8ed55737f263db55e5a35e1 /server
parent257315fd9c0b47064a38a0789ba121ffe3e36bc3 (diff)
downloadnastd-078555c194fd992a2e02e98f20645b82ce1792d3.tar.gz
nastd-078555c194fd992a2e02e98f20645b82ce1792d3.zip
Update for modern MySQL.
Diffstat (limited to 'server')
-rw-r--r--server/mysqldb.c12
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;
}