Re: Error TSQL

From: Fons Rademakers <Fons.Rademakers_at_cern.ch>
Date: Mon, 28 Feb 2005 10:27:36 +0100


Yes, the ROOT cvs is already corrected.

Antonio Amorim wrote:

> Ivan Koji Koga wrote:
> 

>> Hello all, I tried to use the TSQLServer class and i got some error
>> that i don't know. Could some one else explain what is wrong and how
>> to corret it? The MySQL is curretly running in version 4.1.10
>> and login and password are ok.
>> Here is the code...
>> {
>> TSQLServer *db =
>> TSQLServer::Connect("mysql://200.128.80.175:3306/pipesbr","ivan","pass");
>> TSQLResult *res = db->Query("select * from RoundTrip");
>>
>> int nrows = res->GetRowCount();
>> int nfields = res->GetFieldCount();
>>
>> for (int i=0; i < nrows; i++) {
>> TSQLRow *row = res->Next();
>> for (int j = 0; j < nfields; j++) {
>> printf("%s\n", row->GetField(j));
>> }
>> delete row;
>> }
>> delete res;
>> delete db;
>> }
>>
>> -------------------------------------------------------
>> Here is the error...
>>
>>
>> root [0] .x /testesql.C
>> Error in <TMySQLServer::TMySQLServer>: connection to database pipesbr
>> on 200.128.80.175 failed (error: Client does not support
>> authentication protocol requested by server; consider upgrading MySQL
>> client)
>> Error: illegal pointer to class object db 0x0 84 FILE:/testesql.C LINE:4
>> *** Interpreter error recovered ***
>>
>>
> Dear Koji,
> 
>   Probably you have compiled root and linked it to an older version of 
> the mysql client library. It looks like you need to recompile root.
> While doing that, you will see that you probably get an error when 
> compiling the mysql/src/TMySQLServer.cxx
> in the statement:
>   TMySQLServer.cxx:#if MYSQL_VERSION_ID < 50001
> The client API for mysql_shutdown(...) has changed between mysql 
> versions. The manual is probably not very clear but I have checked that 
> at least with mysql 4.1.8, the new API should already be used.
> Therefore, this statement needs to be modified to:
>    TMySQLServer.cxx:#if MYSQL_VERSION_ID < 40108
> 
> You can see the version of your client mysql API by looking into the 
> mysql include file mysql.h and finding MYSQL_VERSION_ID.
> 
> 
> In a debian system, for example, you probably need to compile root with 
> the libmysqlclient14-dev (version 4.1.8  or later).
> 
> Hope this helps a bit,
> 
> Antonio Amorim

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers_at_cern.ch              Phone: +41 22 7679248
WWW:    http://www.rademakers.org/fons/      Fax:   +41 22 7679480
Received on Mon Feb 28 2005 - 10:27:42 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:05 MET