[syslog-ng] "Unable to initialize database access" error

Justin Ryburn justin at ryburn.org
Sat Jan 28 12:33:41 CET 2012


For some reason I cannot seem to get my log messages to go to the mysql database. I get the following error when I attempt to start the syslog-ng service…

jryburn at ryburn-server:/etc/syslog-ng$ sudo service syslog-ng restart
 * Stopping system logging syslog-ng
   ...done.
 * Starting system logging syslog-ng
Unable to initialize database access (DBI); rc='-1', error='No such file or directory (2)'
Error initializing dest driver; dest='d_mysql', id='d_mysql#0'
Error initializing message pipeline;
   ...fail!

The relevant pieces of syslog-ng.conf…

source s_net { udp(); };
source s_tcp { tcp(ip(0.0.0.0) port(1999)); };

# Desitations for remote devices
destination d_routers { file("/var/log/routers.log"); };

# Send logs to the mysql database
destination d_mysql {
        sql(
                type(mysql)
                host("localhost")
                username("syslogadmin")
                password("syslogadmin")
                database("syslog")
                table("logs")
                columns("host", "facility", "priority", "level", "tag", "datetime", "program", "msg")
                values("$HOST_FROM", "$FACILITY", "$PRIORITY", "$LEVEL", "$TAG", "$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC", "$PROGRAM", "$MSG")
                indexes("host", "facility", "priority", "datetime", "program")
        );
};

log { source(s_net); source(s_tcp); destination(d_routers); destination(d_mysql); };

I have verified the username and password are correct and have access to the syslog database. If I remove the "d_mysql" destination, my log statement works correctly and the log files get dumped in to the /var/log/routers.log file just fine. I have gone through the documentation on the website, FAQs, etc. and come up empty. It has me stumped. Any help would be greatly appreciated.

Thanks,
-Justin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20120128/8d064221/attachment.htm 


More information about the syslog-ng mailing list