W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2005

Re: SQL logging compiles but does not work

From: Vic Bancroft <bancroft@america.net>
Date: Mon, 25 Jul 2005 18:18:21 -0400
Message-ID: <42E5652D.9080905@america.net>
To: www-lib@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:45 GMT