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. How to get working Qt mysql driver???

How to get working Qt mysql driver???

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 7.3k 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.
  • D Offline
    D Offline
    dunix
    wrote on last edited by
    #1

    Hi everyone.
    I got this error when I run the project:

    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC

    I've done many things but no positive results. Anyone knows a trick?
    Thanks for reading this.

    P.D. I'm using MacOS

    "Dar ejemplo no es la principal manera de influir sobre los demás, es la única manera" A.Einstein

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

      Hi
      Your mysql driver not installed on your system.
      Download and install it,then try again

      if you have problem for install it, search on this forum for similar topics. ;)

      If You Want You Can!

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        The MySql driver does not come build with your Qt SDK installation for licencing reasons. You will have to build it yourself. There are plenty of topics here on Qt Devnet and elsewhere on the net available on how to do it. You will need to get the Qt sources to do it though, and the MySql SDK.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          batcher
          wrote on last edited by
          #4

          Hi, i successeded to make it work i had explain how in this post, and if it dosen't work just send me a private msg(sorry my english is very bad). http://qt-project.org/forums/viewthread/18828/

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dunix
            wrote on last edited by
            #5

            OK, thanks! I'm looking it right now. (my english it's worse)
            I'll post results later.

            "Dar ejemplo no es la principal manera de influir sobre los demás, es la única manera" A.Einstein

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dunix
              wrote on last edited by
              #6

              Ok, I've done this:

              -> Download Qt sources
              -> Follow this steps :
              http://qt-project.org/doc/qt-4.8/sql-driver.html#qmysql

              But after:
              $qmake "INCLUDEPATH+=/usr/local/mysql/include" "LIBS+=-L/usr/local/mysql/lib -lmysqlclient_r" mysql.pro // Edited to set the real path

              $make // Returns:
              ->make: *** No targets specified and no makefile found. Stop.

              $ls -l output:
              -rwxrwxrwx 1 dunix staff 204 Apr 26 15:46 README
              -rwxrwxrwx 1 dunix staff 2571 Apr 26 15:46 main.cpp
              -rwxrwxrwx 1 dunix staff 122 Apr 26 15:46 mysql.pro
              drwxrwxrwx 5 dunix staff 315 Jul 19 16:45 qsqlmysql_debug.xcodeproj

              What should I do now?
              Thanks everyone.

              "Dar ejemplo no es la principal manera de influir sobre los demás, es la única manera" A.Einstein

              1 Reply Last reply
              0
              • D Offline
                D Offline
                dunix
                wrote on last edited by
                #7

                I got everything working now. I've compiled the sources following Andre s advice.
                Thanks

                "Dar ejemplo no es la principal manera de influir sobre los demás, es la única manera" A.Einstein

                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