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:
_tmain(int argc, _TCHAR* argv)
TSQLServer * oSQLServer = (TSQLServer *)TSQLServer::Connect (“mysql://127.0.0.1:3306/test”,“root”,“1”);
res = oSQLServer->Query(“select * from emp”);
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…
Did you install ROOT with the MySQL option?
Check $ROOTSYS/lib for libMysql.so
If you do not find this library, reconfigure ROOT with, eg
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);
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.
RCS file: /user/cvs/root/config/rootrc.in,v
retrieving revision 1.127
diff -r1.127 rootrc.in
< Plugin.TSQLServer: ^mysql: TMySQLServer MySQL “TMySQLServer(const char*,const char*,const char*)”
Plugin.TSQLServer: ^mysql: TMySQLServer RMySQL "TMySQLServer(const char*,const char*,const char*)"
RCS file: /user/cvs/root/mysql/Module.mk,v
retrieving revision 1.9
diff -r1.9 Module.mk
< MYSQLLIB := $(LPATH)/libMySQL.$(SOEXT)
MYSQLLIB := $(LPATH)/libRMySQL.$(SOEXT)
MYSQLLDFLAGS := -NODEFAULTLIB:LIBCMT.lib
< “$(SOFLAGS)” libMySQL.$(SOEXT) $@ “$(MYSQLO) $(MYSQLDO)” \
"$(SOFLAGS)" libRMySQL.$(SOEXT) $@ "$(MYSQLO) $(MYSQLDO)" \