Re: MySql Driver not loaded
I tried solving it by importing the plugin i did that the following way:
Configured with the following code:
configure -release -plugin-sql-mysql -I "C:\MySql\include" -L "C:\MySql\lib"
Code:
#include <QtPlugin>
Q_IMPORT_PLUGIN(qsqlmysql)
To the code
Made the .pro file with:
qmake -project "QT += sql" "QTPLUGIN += qsqlmysql"
And the when i run make i get the following error:
Code:
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Qt/4.3.0/Projects/hello'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o "release\hello.exe" tmp\obj\re
lease_shared\hello.o -L"c:\Qt\4.3.0\lib" -L"c:\Qt\4.3.0\lib" -lmingw32 -lqtmain
-lQtSql4 -lQtGui4 -lQtCore4 -LC:/Qt/4.3.0/plugins/sqldrivers/ -lqsqlmysql4 -LC:
\MySql\lib
tmp\obj\release_shared\hello.o(.text+0x859):hello.cpp: undefined reference to `q
t_plugin_instance_qsqlmysql()'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\hello.exe] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.3.0/Projects/hello'
mingw32-make: *** [release] Error 2
Re: MySql Driver not loaded
Quote:
Originally Posted by
eekhoorn12
And the when i run make i get the following error:
You need static plugins to make it work that way.
Does sqlbrowser demo see the QMYSQL driver? Check with Dependency Walker whether the plugin can find MySQL DLLs (if not you will have to copy them to the same directory where your executable is).
Re: MySql Driver not loaded
I just reinstalled Mysql and Qt
Mysql to c:\mysql and qt to the default directory
After that i followed again the instructions from http://wiki.qtcentre.org/index.php?t...ws_using_MinGW
After that i configured Qt with the command
configure -static -plugin-sql-mysql -I "C:\MySql\include" -L "C:\MySql\lib"
When that was done i tried the sqldriver demo but it only showed QSQLITE and QODBC
Then i tried -shared -plugin-sql-mysql -I "C:\MySql\include" -L "C:\MySql\lib"
I got the same results.
I used dependency walker to check qsqlmysql4.dll from C:\Qt\4.3.0\plugins\sqldrivers and he got find al the dependency's except MPR.DLL
Re: MySql Driver not loaded
You might try clearing the plugin cache --- maybe there's some stale data in it.
Re: MySql Driver not loaded
I cleared the plugin cache and then did the same thing as my previous post and still i get the same results.
Re: MySql Driver not loaded
Quote:
Originally Posted by
eekhoorn12
I cleared the plugin cache and then did the same thing as my previous post and still i get the same results.
Copy libmysql.dll to %QTDIR%\demos\sqlbrowser\release, start the Qt Command Prompt (there's a link in Start menu) and invoke:
Quote:
cd demos\sqlbrowser\release
sqlbrowser.exe
Can you see QMYSQL plugin in the "Driver" combo box?
Re: MySql Driver not loaded
No still just qsqlite and qodbc
Re: MySql Driver not loaded
try building it static first:
-qt-sql-mysql -I"C:\mysql\include"
and make sure the libmysql.a is present in "C:\Qt\4.3\lib"
if you get compiler errors you can't resolve please post :)
Re: MySql Driver not loaded
Ok i removed all the programs again. Cleaned my register. Reinstalled Mysql and Qt.
After that i followed the following instructions: http://wiki.qtcentre.org/index.php?t...ws_using_MinGW
When i finished that i configured the program with
Code:
configure -qt-sql-mysql -I "C:\mysql\include"
I watched it pass by al de .pro files and noticed that it didn't make the mysql.pro file.
Code:
Reading C:/Qt/4.3.0/src/plugins/imageformats/tiff/tiff.pro
Reading C:/Qt/4.3.0/src/plugins/sqldrivers/sqldrivers.pro
Reading C:/Qt/4.3.0/src/plugins/sqldrivers/sqlite/sqlite.pro
Reading C:/Qt/4.3.0/src/plugins/iconengines/iconengines.pro
Also i didn't place a libmysql.a in the C:\Qt\4.3.0\lib folder but a liblibmysql.a
I tried de sqlbrowser demo and it didn't show mysql and i tried an example script and when i ran it i got the error message driver not loaded
I hope i did everything correct.
Re: MySql Driver not loaded
I have had the same problem and I have found a solution.
with mysql-5.0.41 I was able to compile the plugin for qt, but it just wasn't being loaded. I reverted back to an older version of mysql, in my case, 5.0.27 and everything worked fine.
This may or may not be the problem that you are having, but it is worth a try.
Re: MySql Driver not loaded
Quote:
Originally Posted by
bongobonga
I have had the same problem and I have found a solution.
with mysql-5.0.41 I was able to compile the plugin for qt, but it just wasn't being loaded. I reverted back to an older version of mysql, in my case, 5.0.27 and everything worked fine.
This may or may not be the problem that you are having, but it is worth a try.
And how did you configure evrything?
Re: MySql Driver not loaded
Maybe 2 other things you should check( if you haven't done for so far):
After you configured Qt you get a report which contains the configuration, make sure mysql is yes (or plugin).
Make sure your .pro file contains the line QT += sql
Re: MySql Driver not loaded
If you mean with the report the info get after you verify you want to configure qt the yes it always says that mysql: yes or mysqll: plugin
And when i compile a project i always follow the same three steps.
First: qmake -project "QT += sql"
Second: qmake projectname.pro
Third: make