Re: QMYSQL Driver not found
in your release folder make dir plugins in plugins copy mysql.dll and add below lines in your code
Code:
str.append(".");
qApp->setLibraryPaths(str);
qApp->addLibraryPath("./plugins/");
qDebug()<<"my library path : "<<qApp->libraryPaths();
Mysqlib.load();
qDebug()<<"my library loaded"<< Mysqlib.isLoaded();
Re: QMYSQL Driver not found
The code says that I should have a libmysql.so.
I added the folder and the libmysql.dll file from C:\Windows
But now it seems that not even my development machine works. When I remove the new code the development machine works but when I added back it does not work.
Thanks,
Pericles
Re: QMYSQL Driver not found
I copied the whole plugins folder which includes the sqldrivers folder within it and it seems to do something. Gives me a different error but it might be because it cannot find the remote database and not due to the driver.
I will check that out again by installing MySQL locally and testing on the user computer and then trying to get the remote database to work.
Thanks,
Pericles
Re: QMYSQL Driver not found
qt default it will search in qt dir(c://qt/plugins) for plugins when you run this executable in different machine you should give the library path otherwise it will search again same path(c://qt/plugins) .
Re: QMYSQL Driver not found
This has been covered many times in this forum
You need to deploy the Qt MySQL plugin and the MySQL client library that it depends on along with your application. You deployed application should be arranged like this (Windows):
Code:
C:\Program Files\
Cool App Dir\
coolapp.exe
qtcore4.dll
qtgui4.dll
qtsql4.dll
...
imageformats\
qjeg4.dll
qgif4.dll
...
sqldrivers\
qmysql.dll // <<< the Qt Mysql plugin
libmysql.dll // <<< The MySQL client library from the MySql distribution
plugins\
// any custom plugin you have written for your program to load directly
There is no need to do anything with the Qt library path if you arrange it like that.
Re: QMYSQL Driver not found
And here's how to build qt mysql plugin.