summaryrefslogtreecommitdiffstats
path: root/ulogd/mysql
diff options
context:
space:
mode:
authorlaforge <laforge>2003-08-23 11:40:54 +0000
committerlaforge <laforge>2003-08-23 11:40:54 +0000
commit44bf6e9c4ac39870c2db56daf5c762b8504b7ce4 (patch)
tree6d6fcf703320f08c5a078ef586a4fd952e72cb2a /ulogd/mysql
parent658d56cd5cbee4ba2deae13aaea8e34d6c1a29d2 (diff)
have to call mysql_init() before mysql_real_connect()
Diffstat (limited to 'ulogd/mysql')
-rw-r--r--ulogd/mysql/ulogd_MYSQL.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ulogd/mysql/ulogd_MYSQL.c b/ulogd/mysql/ulogd_MYSQL.c
index 7f14cf8..6b4e331 100644
--- a/ulogd/mysql/ulogd_MYSQL.c
+++ b/ulogd/mysql/ulogd_MYSQL.c
@@ -1,4 +1,4 @@
-/* ulogd_MYSQL.c, Version $Revision: 1.9 $
+/* ulogd_MYSQL.c, Version $Revision: 1.10 $
*
* ulogd output plugin for logging to a MySQL database
*
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: ulogd_MYSQL.c,v 1.9 2003/03/18 10:13:05 laforge Exp $
+ * $Id: ulogd_MYSQL.c,v 1.10 2003/08/11 19:44:07 laforge Exp $
*
* 15 May 2001, Alex Janssen <alex@ynfonatic.de>:
* Added a compability option for older MySQL-servers, which
@@ -310,12 +310,13 @@ static int _mysql_get_columns(const char *table)
/* make connection and select database */
static int _mysql_open_db(char *server, char *user, char *pass, char *db)
{
- dbh = mysql_real_connect(NULL, server, user, pass, NULL, 0, NULL, 0);
-
+ dbh = mysql_init(NULL);
if (!dbh)
return 1;
- mysql_select_db(dbh, db);
+ if (!mysql_connect(dbh, server, user, pass, db, 0, NULL, 0))
+ return 1;
+
return 0;
}