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. MySql with Qt SDK 1.1 in Windows XP

MySql with Qt SDK 1.1 in Windows XP

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 2 Posters 2.7k 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.
  • K Offline
    K Offline
    khalidmushtaq65
    wrote on last edited by
    #1

    Hi everyone,

    I am started Qt a couple of weeks ago.
    I am using windows XP and I want to use mysql with Qt. Can anyone please tell me step by step guide so that I can know how to use mysql with qt? I have searched alot about this but failed to use it. I am using Qt SDK 1.1.

    Thanks in advance for any help..

    Regards,
    Khalid Mushtaq

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dialingo
      wrote on last edited by
      #2

      Hi Khalid,
      the difficult part is to build the QMYSQL plugin. Johan Thelin provided a good description for it.
      http://www.qtcentre.org/wiki/index.php?title=Building_the_QMYSQL_plugin_on_Windows_using_MinGW
      Once you have built the plugin using MySql with Qt should work like a charm.
      Taken from QSqlDatabase documentation:

      @
      QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
      db.setHostName("acidalia");
      db.setDatabaseName("customdb");
      db.setUserName("mojito");
      db.setPassword("J0a1m8");
      bool ok = db.open();
      @

      Not meaning to start a flawmewar but please consider that the mysql driver is GPL which makes your app also GPL unless you pay for it. I am in the process of converting my database from MySql to PostgreSQL because of features, Oracles reputation and license.
      Have Fun
      Roland

      [EDIT: code formatting, pleas use @-tags, Volker]

      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