Results 1 to 2 of 2

Thread: QtSDK : how to connect Qt Creator to MySQL (QMySQL Driver)

  1. #1
    Join Date
    Oct 2011
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QtSDK : how to connect Qt Creator to MySQL (QMySQL Driver)

    This tutorial is just for the SDK user for connecting the Qt Creator to the Database (MySQL).

    Just follow this link : http://ieatbinary.com/2011/07/11/how...k-for-windows/
    it will be useful.

    Things to watch out before proceeding the steps (on above link):

    1. Make sure to install MySQL Server 5.x 32 bit (not 64 bit), and install it on C:\MySQL not C:\MySQL\Program Files (x86)\bla bla bla.
    because it will be easier when u proceed step 4 (on that link).
    if u have installed it on C:\MySQL\Program Files (x86)\bla bla bla, then u have to use dir /x on ur Qt Command Prompt (Qt 4.8.0 for Desktop (MingW))
    to search the short path name of the directory containing space, likes : C:\Program Files (x86)\MySQL\MySQLServer55\bin ---> it will be :
    C:\PROGRA~2\MySQL\MySQLServer55\bin

    2. Rename the My SQL Server 5.5 ----> MySQLServer55 (not containing space)

    3. On step 4. Run these commands (change according to your environment):
    i didn't do the 1st and 2nd step : > set mysql=C:\PROGRA~2\MySQL\MYSQLS~1.5
    > cd \
    i just skip to 3rd step : > cd QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\mysql \

    4. still on step 4, if u have found this error WARNING: (internal):1: Unescaped backslashes are deprecated when executing the qmake "INCLUDEPATH+=blablabla.... , then u have to change one backslashes(\) become two backslashes (\\) on every qmake execution, eg :

    qmake "INCLUDEPATH+=C:\PROGRA~2\MySQL\MySQLServer55\incl ude" "LIBS+=C:\PROGRA~2\MySQL\MySQLServer55\lib\libmysq l.lib" -o Makefile mysql.pro
    become
    qmake "INCLUDEPATH+=C:\\PROGRA~2\\MySQL\\MySQLServer55\\ include" "LIBS+=C:\\PROGRA~2\\MySQL\\MySQLServer55\\lib\lib mysql.lib" -o Makefile mysql.pro

    it Works...

    Sorry if my english is poor, because i'm not the native
    Last edited by wiralim; 6th April 2012 at 11:47. Reason: adding step 4

  2. #2
    Join Date
    Oct 2011
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtSDK : how to connect Qt Creator to MySQL (QMySQL Driver)

    Sry guys, after u have done all the steps and sucessfully adding the QMYSQL DRIVER in Qt, then u should change back the MySQLServer55 directory name to the original name (back to when u installed MySQL Server). It should be like this : MySQL Server 5.5

Similar Threads

  1. Using QtSDk with Mysql 64bit
    By cia.michele in forum Installation and Deployment
    Replies: 0
    Last Post: 29th August 2011, 13:59
  2. SQL Driver for QTSDK 4.7.3
    By rivci in forum Newbie
    Replies: 3
    Last Post: 17th June 2011, 05:40
  3. Help with QMYSQL driver for QT 4.4.0: driver not loaded
    By khikho in forum Installation and Deployment
    Replies: 4
    Last Post: 1st April 2011, 15:00
  4. Mysql unknown database, QMYSQL unable to connect
    By lixo1 in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2010, 21:39
  5. QMYSQL driver
    By pcaeiro in forum Qt Programming
    Replies: 2
    Last Post: 3rd September 2009, 14:35

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.