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 work : Qt 5.0.0 + MySQL in Windows 8

How to work : Qt 5.0.0 + MySQL in Windows 8

Scheduled Pinned Locked Moved Installation and Deployment
3 Posts 2 Posters 3.2k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    rschalch
    wrote on last edited by
    #1

    I just want to share something that worked for me after hours and hours trying to get mysql working with Qt (for those having trouble with it). I've started uninstalling every visual studio on my windows 8 machine (I had 2012, 2010 and Windows SDK for Windows 7 and .NET Framework 3.5 SP1) :

    1. Install Visual C++ Express 2010 and Visual Studio 2010 Express SP1
    2. Add C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin to the Environment Path
    3. Install Qt 5.0.0
    4. Install MySQL 32 bit in C:\MySQL ( be sure of 32 bit version )
    5. Open Visual Studio Command Prompt, go to C:[QtDIR]\5.0.0\Src\qtbase\src\plugins\sqldrivers\mysql\ and run the commands:

    qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MySQL\lib\libmysql.lib" mysql.pro
    nmake

    1. Drivers "must have been created" on C:[QtDIR]\5.0.0\Src\qtbase\plugins\sqldrivers

    2. Copy qsqlmysql.dll, qsqlmysqld.dll and libmysql.dll (this last from MySQL/lib dir) to:
      C:[QtDIR]\5.0.0\msvc2010\plugins\sqldrivers

    3. Create project and add the option "QT += sql" to the "pro" file

    Thats it, hope it helps someone !

    1 Reply Last reply
    0
    • A Offline
      A Offline
      angelicaP
      wrote on last edited by
      #2

      do you have a solution for QPSQL, the plugin for PostgreSQL with MinGw compiler?

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rschalch
        wrote on last edited by
        #3

        sorry, I´ve been working only on MySQL databases :(

        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