PDA

View Full Version : MySQL driver issue



Momergil
1st March 2012, 20:12
Hello!

I need to use MySQL in my application and learning about how to use QSqlDatabase I discovered I don't have the QMYSQL needed to run my application. I did a search in my folders and detected that I have qsql_mysql.h, qsql_mysql.cpp, qsql_mysql.pri and QMYSQLDriver. But the problem is that I don't know how to proceed.

Reading in lots of posts throughout the web and here I noticed it was necessary to install MySQL, do I did it. I also found the mysql.h inside it that once appeared as needed. But I simply don't know what to do, not forgetting that despite there are some helps in this forum about exactly the same problem, none of them was clear enough about how to do.

So, could somebody please give a step-by-step guide about this? I'm using the newest Qt on Windows.

Thanks,

Momergil

ChrisW67
1st March 2012, 21:54
It is the documentation and probably every single post on the topic of missing database plugins. If you are using the Qt SDK then you should fetch the sources that match your libraries first. In case it is not obvious, where the instructions say %QTDIR%/src/... they mean the source code directory structure.

Momergil
2nd March 2012, 18:50
Hello Chris,

thanks for the answers.

I remeber finding this documentation before and gave a read, but the problem is I don't understand too much the "language" used in this documentation (as well as in the other posts of this forum concerned with Qt+MySQL). I'll give a try this evening, but I'm not sure if I'll be able to do it.


then you should fetch the sources that match your libraries first.

What exactly do you mean by that?



Thanks,

Momergil

Added after 50 minutes:

I tried the step by step process but this is what I found:

7463

Translations: 'nmake" is not recognized as a internal or external command, a operable software or a archive.


And now?

Added after 41 minutes:

OK, I was able to go one step foward following this: https://qt-project.org/forums/viewthread/7687

by putting "mingw32-make". But I stoped here. What more is needed? I couldn't do this:


If all goes well, then copy the libmysql.dll from the bin folder of MySQL server installed in QTDIR / bin (I have copied in the folders specified in the PATH)

NB! If you must use a hands QTSDK copy obtained by compiling the library (qsqlmysqld4.dll, libqsqlmysqld4.a) in the following directories:
\ QtSDK \ Desktop \ Qt \ 4.7.3 (or another version) \ mingw \ plugins \ sqldrivers (if you're using a different version of it in the appropriate folder to be copied as well)
\ QtSDK \ Desktop \ Qt \ 4.7.3 (...)\ mingw \ bin
\ QtSDK \ mingw \ bin

Restart.

As suggested by http://www.qtcentre.org/threads/45295-using-mysql-plugin because there wasn't such libmysql.dll in the bin folder, only in the lib. And now where do I put it? And the last part I didn't understand.

Momergil
2nd March 2012, 20:11
OK! I think I solved the problem by following http://ieatbinary.com/2011/07/11/how-to-enable-mysql-support-in-qt-sdk-for-windows/

this instructions.



Momergil

feelgolfclubs
3rd March 2012, 07:42
i am new heer, nice place! i will come here tomorrow!