Results 1 to 2 of 2

Thread: cannot load mysql driver

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default cannot load mysql driver

    I got the error "cannot load mysql driver" or similar, when I wanted to connect to mysql db.

    Although I could solve this problem via terminal, by copying the libqsqlmysql.so library to the folder qt software is installed and running
    the below command:

    qmake "INCLUDEPATH+=-Iusr/include/mysql" "LIBS+=-L/usr/lib/mysql -lmysqlclient_r" findMySQLDriver.pro

    this worked out.

    Now, the sad point is that I cannot make QtCreator connect to mysql at all,

    in qtcreator I added sql to the .pro file, you know. but i donno how to transfer the terminal
    solution to the creator .

    Your

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: cannot load mysql driver

    Qt Creator doesn't load the MySQL driver: your program does. Your program tries to load the driver from a known location in your Qt install. If you have built and installed the MySQL driver for the version of Qt you are using then your program should have no issue finding it. The instructions for building the driver are in the docs. The instructions do not including manually copying a file anywhere.
    Last edited by ChrisW67; 9th July 2012 at 01:21.

Similar Threads

  1. How to load QOCI driver
    By narlapavan in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2012, 01:51
  2. source code for odbc driver or MySql driver in arm-embedded-linux
    By sattu in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 24th January 2011, 10:11
  3. I need MySQL driver for Qt 4.6, WindowsXP(32), MySQL 5.1
    By User_3 in forum Installation and Deployment
    Replies: 7
    Last Post: 15th October 2010, 15:19
  4. SQL driver load problem
    By vieraci in forum Qt Programming
    Replies: 1
    Last Post: 12th December 2009, 14:59
  5. Can't load the postgre driver!
    By brevleq in forum Installation and Deployment
    Replies: 6
    Last Post: 12th January 2008, 05:23

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.