PDA

View Full Version : MySQL flugin, very strang problem. Please help me.



diego
4th June 2009, 08:16
Hi all.

I am trying to connect mysql with QT on window xp system.

I made step:

1. Installed mysql
2. Installed QT SDK
3. I copied mingw-utils-0.3 to %QTDIR%/bin)
4. I did




1. Open a Qt Command Prompt and go to : C:\mysql\lib\opt
2. Run : dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib C:\Qt\2009.02\mingw\lib\libmysql.a
3. reimp libmysql.lib to produce the liblibmysql.a file. It had done.
4. Go to %QTDIR%/src/plugins/sqldrivers/mysql
5. Run the following command: qmake -o Makefile "INCLUDEPATH+=C:\mysql\include" "LIBS+=C:\mysql\lib\opt\liblibmysql.a" mysql.pro
6. Run make - this should build the qsqlmysql.dll and libqsqlmysql.a files in the %QTDIR%/plugins/sqldrivers directory.
7. Copy the libmysql.dll file from the MySQL installation's bin directory to a directory in %PATH% (e.g. %QTDIR%/bin).


I made i simple QT connecttion



QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("209.59.209.13");
db.setDatabaseName("test");
db.setUserName("tara");
db.setPassword("d5aquExV");


it still has a wrong message


QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC


Please help me. What step i was wrong or what happends to me.
Thanks in advance.
Diego

e8johan
5th June 2009, 08:09
Have you looked at the wiki: http://wiki.qtcentre.org/index.php?title=Building_the_QMYSQL_plugin_on_Wind ows_using_MinGW