<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.5">
</HEAD>
<BODY>
I have installed syslog-ng 3.0.1, open source edition, binary package in RHEL 5.3 system. I'm having trouble to have it writing to MySQL DB using native driver. The current configuration file looks like:<BR>
# Write the logs to MySQL DB<BR>
destination dd_mysql {<BR>
        sql(type(mysql)<BR>
        host("localhost") username("syslogadmin") password("syslogadmin")<BR>
        database("syslog")<BR>
        table("logs")<BR>
        columns("host", "facility", "priority", "level", "tag", "datetime", "program", "msg", "seq")<BR>
        values("$HOST", "$FACILITY", "$PRIORITY", "$LEVEL", "$TAG", "$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC", "$PROGRAM", "$MSG", "$SEQ")<BR>
        indexes("seq"));<BR>
#        program("/usr/bin/mysql -usyslogadmin -psyslogadmin syslog"<BR>
#        template("INSERT INTO logs (host, facility, priority, level, tag, datetime, program, msg, seq)<BR>
#        VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', '$PROGRAM', '$MSG', '$SEQ' );\n")<BR>
#        template-escape(yes));<BR>
};<BR>
It works if I use the program driver, as currently commented out. <BR>
The table is configured as following, using the schema defined by php-syslog-ng 2.9.8m.<BR>
+----------+---------------------+------+-----+---------+----------------+<BR>
| Field | Type | Null | Key | Default | Extra |<BR>
+----------+---------------------+------+-----+---------+----------------+<BR>
| id | bigint(20) unsigned | NO | PRI | NULL | auto_increment | <BR>
| host | varchar(128) | YES | MUL | NULL | | <BR>
| facility | varchar(10) | YES | MUL | NULL | | <BR>
| priority | varchar(10) | YES | MUL | NULL | | <BR>
| level | varchar(10) | YES | | NULL | | <BR>
| tag | varchar(10) | YES | | NULL | | <BR>
| datetime | datetime | YES | MUL | NULL | | <BR>
| program | varchar(15) | YES | MUL | NULL | | <BR>
| msg | text | YES | | NULL | | <BR>
| seq | bigint(20) unsigned | NO | MUL | 0 | | <BR>
| counter | int(11) | NO | | 1 | | <BR>
| fo | datetime | YES | | NULL | | <BR>
| lo | datetime | YES | | NULL | | <BR>
+----------+---------------------+------+-----+---------+----------------<BR>
What is the problem? <BR>
Thanks in advance for the help.<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</BODY>
</HTML>