diff options
author | Brian Cully <bjc@kublai.com> | 2008-04-15 11:57:30 -0400 |
---|---|---|
committer | Brian Cully <github.20.shmit@spamgourmet.com> | 2008-04-15 11:57:30 -0400 |
commit | 078555c194fd992a2e02e98f20645b82ce1792d3 (patch) | |
tree | eb428867a52e5c9be8ed55737f263db55e5a35e1 | |
parent | 257315fd9c0b47064a38a0789ba121ffe3e36bc3 (diff) | |
download | nastd-078555c194fd992a2e02e98f20645b82ce1792d3.tar.gz nastd-078555c194fd992a2e02e98f20645b82ce1792d3.zip |
Update for modern MySQL.
-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; } |