[syslog-ng] "Unable to initialize database access" error
Balazs Scheidler
bazsi at balabit.hu
Sun Jan 29 13:49:57 CET 2012
On Sat, 2012-01-28 at 05:33 -0600, Justin Ryburn wrote:
> 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.
the mysql libdbi driver is probably missing.
--
Bazsi
More information about the syslog-ng
mailing list