Results 1 to 2 of 2

Thread: newbie's question: Can't see QMYSQL driver, libqsqlmysql.dylib on Mac OS X 10.6

  1. #1
    Join Date
    May 2011
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default newbie's question: Can't see QMYSQL driver, libqsqlmysql.dylib on Mac OS X 10.6

    Hi every one, This is my 1st post on this forum. I am new to Qt
    I just recently installed mysql and decided to try some db stuff. I went through all required procedures and made libqsqlmysql.dylib file without error(s). This is the output of otool:

    libqsqlmysql.dylib:
    libqsqlmysql.dylib (compatibility version 0.0.0, current version 0.0.0)
    libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0)
    /opt/local/lib/libQtSql.4.dylib (compatibility version 4.7.0, current version 4.7.3)
    /opt/local/lib/libQtCore.4.dylib (compatibility version 4.7.0, current version 4.7.3)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)

    then I copied libqsqlmysql.dylib to /Developer/Applications/Qt/plugins/sqldrivers/

    printing qDebug()<<QSqlDatabase::drivers(); in the terminal gives me:
    ("QSQLITE", "QODBC3", "QODBC")

    I can't see "QMYSQL" there. My questions are:
    1- According to otool, did I miss anything or these versions are compatible?
    2-Did I copied the libqsql... to a correct path.
    3-How can I resolve this issue?

    Please accept my apology if this question is not posted in appropriate category (I am completely new to Qt, Mac and your forum). Thank you so much.

  2. #2
    Join Date
    Apr 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: newbie's question: Can't see QMYSQL driver, libqsqlmysql.dylib on Mac OS X 10.6

    I don't know if fixed this already, but I had the same problem as you have. Your plugin is linking against the wrong mysqlclient library. You fix this by running the install_name_tool command:

    Qt Code:
    1. install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient_r.18.dylib libqsqlmysql.dylib
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. 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
  2. QMYSQL driver not loaded
    By cydside in forum Qt Programming
    Replies: 4
    Last Post: 31st March 2010, 02:18
  3. QMYSQL driver not loaded
    By akhila in forum Newbie
    Replies: 1
    Last Post: 22nd February 2010, 18:24
  4. QMYSQL driver
    By pcaeiro in forum Qt Programming
    Replies: 2
    Last Post: 3rd September 2009, 14:35
  5. QMYSQL driver
    By Fastman in forum Installation and Deployment
    Replies: 2
    Last Post: 26th October 2007, 08:14

Tags for this Thread

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.