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
I made i simple QT connecttion
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).
it still has a wrong messageQSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("1.2.3.4");
db.setDatabaseName("test");
db.setUserName("<user>");
db.setPassword("<password>");
Please help me. What step i was wrong or what happends to me.QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC
Thanks in advance.
Diego
Bookmarks