Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Need Help Installing MySQL Driver on Windows XP 32-Bit for QT 5
Forum Updated to NodeBB v4.3 + New Features

Need Help Installing MySQL Driver on Windows XP 32-Bit for QT 5

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.9k 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.
  • T Offline
    T Offline
    tenbusch
    wrote on last edited by
    #1

    I am trying to install the mysql driver for MySQL 5.5 and Qt 5 as per the instructions in the Qt Help - but I am unable to get it to work.

    What I have done:

    1. Installed Visual Studio 10
    2. Installed MySQL 5.5 full install
    3. Install Qt5
    4. Wrote the following code in main.cpp:
      @

    #include <QCoreApplication>
    #include <QtCore>
    #include <QtSql>

    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);

    qDebug() << QSqlDatabase::drivers();
    
    return a.exec&#40;&#41;;
    

    }

    @
    5) added sql to the project file for above main.cpp file:
    @

    #-------------------------------------------------

    Project created by QtCreator 2012-12-21T07:52:30

    #-------------------------------------------------

    QT += core sql

    QT -= gui

    TARGET = DBConsoleApp
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += main.cpp

    @

    1. Opened windows shell from Qt Start Menu and cd'ed in the plugins directory - i.e.C:\Qt\Qt5.0.0\5.0.0\msvc2010\plugins\sqldrivers
    2. mkdir mysql
    3. cd mysql - so now in C:\Qt\Qt5.0.0\5.0.0\msvc2010\plugins\sqldrivers\mysql directory
    4. typed the following as per help instructions:
      @

    qmake "INCLUDEPATH+=C:/Program Files/MySQL/MySQL 5.5 Server/include" "LIBS+=C:/Program Files/MySQL/MySQL 5.5 Server/lib/libmysql.lib" mysql.pro

    @
    10) Received output from qmake:
    @
    Cannot find file: mysql.pro.
    @

    This is as far as I can get.

    Please assist.
    Thanks,

    Albert

    1 Reply Last reply
    0
    • C Offline
      C Offline
      clochydd
      wrote on last edited by
      #2

      Hi Albert,

      I had a similar problem with the Linux QT5 and the psql driver.
      If you get the "Cannot find mysql.pro" you probably won't have the sources installed? You should check that first and once you have localized your mysql.pro just try compiling the plugin with the Creator.

      Good luck

      Erich

      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