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. Cannt connect to mysql in QT 4.7.2
QtWS25 Last Chance

Cannt connect to mysql in QT 4.7.2

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

    hi
    im beginner in QT!!!
    and i have a problem with connecting to mysql
    i install offline QT and use ubuntu 11.04

    when run my program, show this error:
    bq.
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE

    What should I do?
    please step by step!!!

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tucnak
      wrote on last edited by
      #2

      Hello, ~vahidsamimi!

      You should have problems with drivers. Your error log tells that you only have QSQLITE driver for databases. If you want to have QMYSQL driver - you must have it in your Qt.

      The best solution is to configure Qt (build sources) in this way:
      @
      ./configure <some keys> -qt-sql-mysql
      @

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vahidsamimi
        wrote on last edited by
        #3

        hi tucnak
        thanks for your answer
        but how can i configure QT!!!???
        can you tell a example ???

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tucnak
          wrote on last edited by
          #4

          You should to download Qt Sources, configure and build them. Or you can download Qt SDK - it has QMYSQL driver in defaults.

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vahidsamimi
            wrote on last edited by
            #5

            but i downloaded QT SDK from here:
            http://qt.nokia.com/downloads/sdk-linux-x11-64bit-cpp-offline

            but it has not QMYSQL driver in defaults!

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tucnak
              wrote on last edited by
              #6

              Oh, sorry. I said wrong thing.

              == SOLUTION ==

              1. Download Qt 4.8.2 sources
              2. Extract them to some dir
              3. Read README
              4. When you will be on step "Configure" - configure it with keys you need + "qt-sql qt-sql-mysql"
              5. ?????
              6. PROFIT!!1
              1 Reply Last reply
              0
              • V Offline
                V Offline
                vahidsamimi
                wrote on last edited by
                #7

                hi
                i downloaded QT 4.8.2 source and installed this!!!
                but i have a question!
                how can i running QT 4.8.2?!!
                where is qtcreator file?

                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