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. Help with mysql driver @ os x
Forum Updated to NodeBB v4.3 + New Features

Help with mysql driver @ os x

Scheduled Pinned Locked Moved Installation and Deployment
9 Posts 4 Posters 8.1k 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.
  • E Offline
    E Offline
    elminster
    wrote on last edited by
    #1

    Hello,

    I'm trying to install the mysql driver in OS X 1.6.4
    I was reading the documentation, it seem easy. I compiled and install it, first time the $QTDIR env-var was not right, even corrected it, QT still not found the driver.

    libqsqlmysql.dylib and libqsqlmysql_debug.dylib are both present in /Developer/Applications/Qt/plugins/sqldrivers

    Can anybody help me?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Is the directory in the library search path?

      You can check with the following code snippet:

      @
      #include <QDebug>

      int main( int argc, char ** argv )
      {
      // ...
      qDebug() << QCoreApplication::libraryPaths()
      // ...
      }
      @

      The output should contain "/Developer/Applications/Qt/plugins" (the sqldrivers part is added autmatically).

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • E Offline
        E Offline
        elminster
        wrote on last edited by
        #3

        I tried, the output is:

        Iniciando /Users/elminster/arti/arti.app/Contents/MacOS/arti...
        QSqlDatabase: QMYSQL driver not loaded
        QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC QPSQL7 QPSQL
        ("/Developer/Applications/Qt/plugins", "/Users/elminster/arti/arti.app/Contents/MacOS")
        /Users/elminster/arti/arti.app/Contents/MacOS/arti finalizó retornando 0

        The files are in the directory, i tried even use the QPluginLoader, it do not work.

        It's posible i builded the files in the wrong way?

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          Are the mysql libs available? You can check with

          @
          otool -L /Developer/Applications/Qt/plugins/sqldrivers/libqsqlmysql.dylib
          @

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • E Offline
            E Offline
            elminster
            wrote on last edited by
            #5

            The output is:

            otool -L /Developer/Applications/Qt/plugins/sqldrivers/libqsqlmysql.dylib/Developer/Applications/Qt/plugins/sqldrivers/libqsqlmysql.dylib: libqsqlmysql.dylib (compatibility version 0.0.0, current version 0.0.0)
            libmysql.16.dylib (compatibility version 16.0.0, current version 16.0.0)
            QtSql.framework/Versions/4/QtSql (compatibility version 4.6.0, current version 4.6.2)
            QtCore.framework/Versions/4/QtCore (compatibility version 4.6.0, current version 4.6.2)
            /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
            /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 103.0.0)
            /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              There is no path with the mysql library (libmysql.16.dylib). Are you sure this lib is in your library search path?

              You can search for the lib using locate, and try to add the directory of the lib to DYLD_LIBRARY_PATH

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • E Offline
                E Offline
                eric.maeker
                wrote on last edited by
                #7

                I had the same problem.
                I'm using this script to build the plugin:

                http://code.google.com/p/freemedforms/source/browse/trunk/scripts/mac-create-mysql-plugin.sh
                

                then you must relink the plugin using command

                install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib libqsqlmysql.dylib
                

                This is a good solution for a local install but not for deploying apps. In this case you should link using the @executable_path

                Eric
                http://www.freemedforms.com

                1 Reply Last reply
                0
                • E Offline
                  E Offline
                  eric.maeker
                  wrote on last edited by
                  #8

                  One more information, the plugin builded on MacOS 10.6 is a 64bits edition (linked to the 64bits MySQL lib). You can not configure your app to be 32/64bits.

                  Adding:

                  @
                  CONFIG *= x86 x86_64
                  @

                  to your project file, will cause the plugin to be non-loadable.

                  Eric

                  [EDIT: fixed code markup, Volker]

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MAMartins
                    wrote on last edited by
                    #9

                    similar problem here:
                    http://developer.qt.nokia.com/forums/viewthread/5258/
                    thanks

                    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