Re: SQL logging compiles but does not work

Here is a diff that allows the compile of HTSQL.c without using 
deprecated functions,

    diff -r2.2 HTSQL.c
    23a24,29
     > /* updates for to remove deprecated mysql functions */
     > #define mysql_connect(m,h,u,p)
    mysql_real_connect((m),(h),(u),(p),NULL,0,NULL,0)
     > /* mysql documentation indicates that database names have a
    maximun of 65 characters */
     > #define CREATE_DB_BUFFER_SIZE 128
     > #define CREATE_DB_QUERY_FORMAT "create database %s"
     >
    229a236
     >
    243c250,255
    <               if (mysql_create_db(me->psvr, db) < 0) {
    ---
     >             char CREATE_DB_BUFFER[CREATE_DB_BUFFER_SIZE];
     >             snprintf( CREATE_DB_BUFFER,
     >                       (size_t)CREATE_DB_BUFFER_SIZE,
     >                       CREATE_DB_QUERY_FORMAT,
     >                       db );
     >               if (mysql_query(me->psvr, CREATE_DB_BUFFER) < 0) {

After some reading, it would appear that the library should create the 
appropriate database and table definitions, if they do not already 
exist.  However, this would not work if the account specified with the 
-sqluser option does not have create database and table privileges.  
Perhaps you could try with a user created with all privileges, e.g.,

    GRANT ALL PRIVILEGES ON *.* TO 'webbot'@'localhost' IDENTIFIED BY
    'libwww' ;

more,
l8r,
v

-- 
america sig

Received on Monday, 25 July 2005 22:18:53 UTC