Connecting with MySQL ROOT doesn't return TMySQLServer class

I am trying to use root for making an application which is going to provide global and local indexing for a distributed database system.

So to start I need to connect to a database to implement and test my algos for indexing.

My platform is currently windows 2003, with mysql 4.0 and root 4.x. and my code currently looks like this:


#include "e:\root\include\TSQLServer.h"

_tmain(int argc, _TCHAR* argv[])
TSQLServer * oSQLServer = (TSQLServer *)TSQLServer::Connect (“mysql://”,“root”,“1”);
TSQLResult *res;
res = oSQLServer->Query(“select * from emp”);
return 0;

The error which i am encountering is:

Error in TPluginHandler::SetupCallEnv: class TMySQLServer not found in plugin MySQL

Also I have already tested this table and database via other applications using OLEDB and everythings fine on the mysql side.

Kindly guide as to what should be my next step to resolve this error…

Kind Regards

Adnan Abid

Did you install ROOT with the MySQL option?
Check $ROOTSYS/lib for

If you do not find this library, reconfigure ROOT with, eg


Hi Brun,

Thanks for your post…

Actually we have this dll installed on the system where we are writing this software. Also the test platform is currently windows due to our lack of capability in linux kdevelop debugging. However we will soon shift this project to a linus system. The error however still persists…

Today we debugged this call and found out that the following code
(in TObjArray.h) is where the problem occurs…

TObject *THashTable::FindObject(const char *name) const
// Find object using its name. Uses the hash value returned by the
// TString::Hash() after converting name to a TString.

Int_t slot = GetHashValue(name);
if (fCont[slot]) return fCont[slot]->FindObject(name);
return 0;

In the above code snippet, fCont[slot] variable refers to a null element, hence a failed fetch…

Please also shine some light on the root and mysql initialization for an application that is being developed on windows.

My Kindest Regards


Unfortunately the configure script is not quite correct for MySQL on windows.
In order to make it go properly you have to change config/Makefile.config to replace mysqlclient.lib by libmysql.lib and apply for a patch.

Index: config/

RCS file: /user/cvs/root/config/,v
retrieving revision 1.127
diff -r1.127
< Plugin.TSQLServer: ^mysql: TMySQLServer MySQL “TMySQLServer(const char*,const char*,const char*)”

Plugin.TSQLServer: ^mysql: TMySQLServer RMySQL "TMySQLServer(const char*,const char*,const char*)"
Index: mysql/
RCS file: /user/cvs/root/mysql/,v
retrieving revision 1.9
diff -r1.9


< “$(SOFLAGS)” libMySQL.$(SOEXT) $@ “$(MYSQLO) $(MYSQLDO)” \

             "$(SOFLAGS)" libRMySQL.$(SOEXT) $@ "$(MYSQLO) $(MYSQLDO)" \