[syslog-ng] Syslog-ng and Mysql Not working

Girish-Agarwal (Contractor) Girish.Agarwal at OfficeDepot.com
Thu Dec 2 16:12:03 CET 2010


Thanks Matthew for all your help in trying to get this resolved. However
can you kindly let me know where should I add this flag or option, or
can you pass a working example  :-

Here are my options from syslog-ng.conf file.

options {
        stats_freq(3600);
        keep_hostname(yes);
        flush_lines(16);
        log_fifo_size(16384);
        };

And here is the destination mysql directive 

destination d_mysql {
        sql(type(mysql)
        host("dbhost") port("4406") username("syslog")
password("syslog")
        database("testdb")
        table("logs")
        columns("host", "facility", "priority", "tag", "datetime",
"program", "server", "msg" )
        values("$HOST_FROM", "$FACILITY", "$PRIORITY",  "$TAG",
"$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC", "$PROGRAM", "testbox", "$MSG" )

       indexes());
};
    

Regards,
Girish


-----Original Message-----
From: syslog-ng-bounces at lists.balabit.hu
[mailto:syslog-ng-bounces at lists.balabit.hu] On Behalf Of Matthew Hall
Sent: Wednesday, December 01, 2010 5:57 PM
To: Syslog-ng users' and developers' mailing list
Subject: Re: [syslog-ng] Syslog-ng and Mysql Not working

See this:

http://www.engardelinux.org/modules/index/list_archives.cgi?list=syslog-
ng-users&page=0102.html&month=2010-11

You need the dont-create-tables flag.

Which for some weird reason is still not in the 3.2 manual.

Matthew.

On Wed, Dec 01, 2010 at 02:57:59PM -0500, Girish-Agarwal (Contractor)
wrote:
> Hi,
>     We are trying to setup syslog-ng to directly log messages to mysql
> but I get the following Error in the client messages file:-
> 
>     Dec  1 14:45:27 testbox syslog-ng[15637]: Error running SQL query;
> type='mysql', host='10.10.10.10', port='4406', user='syslog',
> database='testdb', error='1142: create command denied to user:
> \'syslog at 10.20.30.40\' for table \'logs\'', query='CREATE TABLE logs
> (host text, facility text, priority text, tag text, datetime text,
> program text, server text, msg text)'
> Dec  1 14:45:27 testbox syslog-ng[15637]: Error checking table,
> disconnecting from database, trying again shortly; time_reopen='60'
> 
>  I am really confused as to why it is trying to create Table into the
> database. I already have the table created and I have verified
> successful connection from this box to the database server. It needs
to
> insert the entries into the database and should not try to CREATE
TABLE.
>   
>     I am using syslog-ng 3.0.6 version .
> 
> Regards,
> Girish
> 
> 

>
________________________________________________________________________
______
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Documentation:
http://www.balabit.com/support/documentation/?product=syslog-ng
> FAQ: http://www.campin.net/syslog-ng/faq.html
> 

________________________________________________________________________
______
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation:
http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.campin.net/syslog-ng/faq.html



More information about the syslog-ng mailing list