Results 1 to 5 of 5

Thread: MySQL driver issue

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default MySQL driver issue

    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

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: MySQL driver issue

    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.

  3. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MySQL driver issue

    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:

    make.png

    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/4529...g-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.
    Last edited by Momergil; 2nd March 2012 at 18:50.

  4. #4
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MySQL driver issue

    OK! I think I solved the problem by following http://ieatbinary.com/2011/07/11/how...k-for-windows/

    this instructions.



    Momergil

  5. #5

    Default Re: MySQL driver issue

    i am new heer, nice place! i will come here tomorrow!

Similar Threads

  1. MySQL driver on Mac OS X
    By Vit_H in forum Qt Programming
    Replies: 4
    Last Post: 21st March 2011, 21:26
  2. source code for odbc driver or MySql driver in arm-embedded-linux
    By sattu in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 24th January 2011, 10:11
  3. I need MySQL driver for Qt 4.6, WindowsXP(32), MySQL 5.1
    By User_3 in forum Installation and Deployment
    Replies: 7
    Last Post: 15th October 2010, 15:19
  4. MySql driver problem
    By stilgar in forum Qt Programming
    Replies: 1
    Last Post: 13th April 2010, 10:26
  5. [qt 4.6] mysql driver
    By vinny gracindo in forum Newbie
    Replies: 0
    Last Post: 25th February 2010, 22:28

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.