Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to build mysql driver with mingw on windows ?
QtWS25 Last Chance

How to build mysql driver with mingw on windows ?

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 3 Posters 6.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qeast
    wrote on 8 Nov 2013, 03:32 last edited by
    #1

    I need a connect to MySQL by Qt5.1.1 on Windows today.
    In the help of Qt5.1.1, there are contents for "How to build the MySQL driver for MinGW users " and "How to Build the QMYSQL Plugin on Windows" just for Qt4.6.2.

    It says,

    1. go to %MySQL_PATH%\lib\opt, and run commands :

      reimp -d libmysql.lib

      dlltool -k -d libmysql.def -l libmysql.a

    2. go to C:\Qt\4.6.2 and run commands:

      configure.exe -debug-and-release -platform win32-g++ -qt-sql-mysql -l mysql -I C:\MySQL\MySQL51\include -L C:\MySQL\MySQL51\lib\opt

      mingw32-make sub-src

    3)go to C:\Qt\4.6.2\src\plugins\sqldrivers\mysql and run command:

      > qmake "INCLUDEPATH+=C:/MySQL/MySQL51/include" "LIBS+=-L. mysql" mysql.pro
    

    But I meet several problems by building MySQL driver for Qt5.1.1.

    1. I succeed in running commands in step1 above and get "libmysql.def" and "libmysql.a"

    2. In step 2, I move to qt path and run the "configure.exe ....", in fact there is no command for configure.exe.
      I search for "configure" in the whole qt folder, and can find nothing.

    3. In step 3, I can only find folder C:\Qt\Qt5.1.1\5.1.1\mingw48_32\plugins\sqldrivers on my pc, there is no "%Qt_PATH%\src\plugins\sqldrivers\mysql" folder.
      So, "mysql.pro" cannot be found also.

    My environment:

    1. qt-windows-opensource-5.1.1-android-x86-win32-offline.exe
    2. mingw-utils-0.3.tar.gz
    3. mingw-5.1.6.exe
    4. mysql-5.5.31-win32.msi

    Does anyone know why? Who can give me a hand~
    Thank you very much! :)

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Nov 2013, 08:07 last edited by
      #2

      Hi and welcome to devnet,

      You need to download Qt's sources in order to build the plugin (you don't need to rebuild all of Qt, just the mysql plugin part)

      Happy coding !

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        Qeast
        wrote on 12 Nov 2013, 10:35 last edited by
        #3

        So glad that you can answer my question.
        Thank you~ : )

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 12 Nov 2013, 12:21 last edited by
          #4

          You're welcome !

          Since you could go forward, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Muhammad
            wrote on 12 Apr 2014, 03:51 last edited by
            #5

            Hello Guys I’ve Qt 5.2.1 ×86 for Android, I’m using windows 8 64bit. and I don’t know what exactly should I do to make my application that uses MySQL works in Android.
            Note: the Application works fine on desktop.
            Please help

            I don't have endpoint, I just have Checkpoints.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 12 Oct 2014, 20:54 last edited by
              #6

              There's no official MySQL package available for that platform. The thing that you can do is to first build mariaDB by hand for Android. IIRC there's a description of that process in the forum or the wiki pages. However, be aware that you should not try to access a database directly from the internet. Use a web service for that.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved