webbot with mysql

View: New views
4 Messages — Rating Filter:   Alert me  

webbot with mysql

by xavier.torne :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,
i'm trying to work with webbot with mysql, but don't work.
I compiled with the correct options: ./configure --with-mysql=/usr/lib (i'm
using ubuntu with mysql 5.0.22).
I put in source modifications to see what happens, and when i execute robot
with:
{ROBOT} -q -ss -n -depth 99 -prefix ${ROOT} -img -imgprefix ${IMGROOT}
-sqlserver localhost -sqluser webbot -sqldb webbot -sqlpassword libwww ${ROOT}

i find :  Error: Can't connect to MySQL server on 'localhost' (111)
i modificated :

PUBLIC BOOL HTSQL_connect (HTSQL * me)
{
    if (me && me->host) {
        HTTRACE(SQL_TRACE, "SQL connect. Open a link to server `%s\'\n" _ me->host);

// me->psvr = mysql_connect(&(me->server), me->host,me->user, me->password);
                                 // me->user ? me->user : "",
                                 //me->password ? me->password : "");
        if(!mysql_real_connect(&(me->server), me->host,me->user,
me->password,NULL,0,NULL,0)){

          fprintf(stderr, "Failed to connect to database: Error: %s\n",
                  mysql_error(&(me->server)));
        }

the vars are ok, and the mysql runs, and the user for the mysql is created (with
grant and all privileges), but doesn't connect to this, i don't know because.
I hope somebody know this! Please! Thanks!

PD:Sorry for my english




Parent Message unknown RE: webbot with mysql

by Adam Mlodzinski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I haven't used the my-sql support with libwww, but I have used other
optional support (ssl).  The configure script prints out a whole bunch
of information - in that information it tells you if it found the mysql
libraries.

Look for the following:
        checking whether to support mysql access.... no

Except, in your case, it should say 'yes'.  I suspect that this part is
working properly for you, or you would be seeing more severe failures -
but it's somewhere to start.

Have you tried enabling tracing? What output do you get?

--
Adam M.


Parent Message unknown RE: webbot with mysql

by Adam Mlodzinski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Great!

----Original Message----
From: xavier.torne@...
Sent: Thursday, July 20, 2006 11:13 AM
Subject: RE: webbot with mysql

> It just works!
> i put mysql_init function and it works!!
> Thanks :D



Re: webbot with mysql

by Vic Bancroft-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Sometimes the wheels of change turn at glacial speeds. The webbot
logging to mysql solution discovered by Xavier Torne and reported by
Adam Mlodzinski has been committed in the new revision, 2.5, of
Library/src/HTSQL.c . . .

The critical part of the diff is

    Index: HTSQL.c
    ===================================================================
    RCS file: /sources/public/libwww/Library/src/HTSQL.c,v
    retrieving revision 2.4
    diff -r2.4 HTSQL.c
    188a189
     >     me->psvr = mysql_init( &(me->server) );

more,
l8r,
v

--
"The future is here. It's just not evenly distributed yet."
 -- William Gibson, quoted by Whitfield Diffie