Results 1 to 20 of 22

Thread: Yet *another* MYSQL drivers not loaded issue

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2009
    Posts
    140
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    22

    Default Re: Yet *another* MYSQL drivers not loaded issue

    Well, this is a little late for a followup but as the Qt Updater recently broke my installation of Qt (see previous post of mine) I decided to download and install 4.7.3 (online installer), and now I'm faced with this 'QMYSQL drivers not loaded' nightmare all over again.

    If not, follow the procedure described in the docs.
    Ha! If only. I went to the doc page and neither set of commands given there worked. Specifically,

    cd $QTDIR/src/plugins/sqldrivers/mysql
    qmake "INCLUDEPATH+=/usr/local/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" mysql.pro
    make
    gave me

    In file included from main.cpp:44:
    ../../../sql/drivers/mysql/qsql_mysql.h:52:19: error: mysql.h: No such file or directory
    and

    cd $QTDIR/src/plugins/sqldrivers/mysql
    make install
    gave me

    *** No rule to make target `install'. Stop.
    I note that $QTDIR isn't defined on my system (so I had to type in the full path, namely QtSDK/QtSources/4.7.3) but I don't see how that should mean anything, I just mention it for completeness.

    Has anybody who installed Qt from the online (or offline) installer successfully managed to access the QMYSQL database (or any database besides QSqlLite)? Or do I have to cross my fingers and build Qt from the .tar file again?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Yet *another* MYSQL drivers not loaded issue

    You have MySql installed, right?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2009
    Posts
    140
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    22

    Default Re: Yet *another* MYSQL drivers not loaded issue

    Yes, up until the reinstall I had been using Qt and MySQL together, successfully, as described in post #9. Connecting to databases, running queries, etc. I also am able to access MySQL databases through independent tools (MySQL Administrator and MySQL Query Browser). I can rebuild from the .tar file as in #9 but that takes hours and it seems ridiculous to have to go through that just to get the MySQL drivers.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Yet *another* MYSQL drivers not loaded issue

    Is mysql.h present in /usr/local/include?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Aug 2009
    Posts
    140
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    22

    Default Re: Yet *another* MYSQL drivers not loaded issue

    No I didn't, I had it in /usr/include/mysql. When I put it in /usr/local/include and re-ran the qmake/make commands, I got

    g++ -c -pipe -O2 -fvisibility=hidden -fvisibility-inlines-hidden -D_REENTRANT -Wall -W -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/local/include -I. -o main.o main.cpp
    In file included from ../../../sql/drivers/mysql/qsql_mysql.h:52,
    from main.cpp:44:
    /usr/local/include/mysql.h:70:27: error: mysql_version.h: No such file or directory
    /usr/local/include/mysql.h:71:23: error: mysql_com.h: No such file or directory
    /usr/local/include/mysql.h:72:24: error: mysql_time.h: No such file or directory
    /usr/local/include/mysql.h:74:70: error: my_list.h: No such file or directory
    /usr/local/include/mysql.h:132:21: error: typelib.h: No such file or directory
    /usr/local/include/mysql.h:147:22: error: my_alloc.h: No such file or directory
    In file included from ../../../sql/drivers/mysql/qsql_mysql.h:52,
    from main.cpp:44:
    /usr/local/include/mysql.h:115: error: use of enum ‘enum_field_types’ without previous declaration
    /usr/local/include/mysql.h:153: error: ‘MEM_ROOT’ does not name a type
    /usr/local/include/mysql.h:260: error: ‘NET’ does not name a type
    /usr/local/include/mysql.h:266: error: ‘MEM_ROOT’ does not name a type
    /usr/local/include/mysql.h:285: error: ‘SCRAMBLE_LENGTH’ was not declared in this scope
    /usr/local/include/mysql.h:302: error: expected ‘;’ before ‘*’ token
    /usr/local/include/mysql.h:326: error: ‘MEM_ROOT’ does not name a type
    /usr/local/include/mysql.h:350: error: ‘NET’ does not name a type
    /usr/local/include/mysql.h:518: error: use of enum ‘mysql_enum_shutdown_level’ without previous declaration
    /usr/local/include/mysql.h:525: error: use of enum ‘enum_mysql_set_option’ without previous declaration
    /usr/local/include/mysql.h:672: error: ‘NET’ has not been declared
    /usr/local/include/mysql.h:683: error: use of enum ‘enum_field_types’ without previous declaration
    /usr/local/include/mysql.h:695: error: ‘MEM_ROOT’ does not name a type
    /usr/local/include/mysql.h:696: error: ‘LIST’ does not name a type
    /usr/local/include/mysql.h:724: error: ‘MYSQL_ERRMSG_SIZE’ was not declared in this scope
    /usr/local/include/mysql.h:725: error: ‘SQLSTATE_LENGTH’ was not declared in this scope
    /usr/local/include/mysql.h:767: error: use of enum ‘enum_server_command’ without previous declaration
    make: *** [main.o] Error 1

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Yet *another* MYSQL drivers not loaded issue

    How about passing /usr/local/include/mysql instead of /usr/local/include into configure? The problems you are having are strictly related to files and compilers and not to Qt and MySql.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. The following user says thank you to wysota for this useful post:

    MattPhillips (23rd June 2011)

Similar Threads

  1. Mysql drivers
    By thahir1986 in forum Newbie
    Replies: 2
    Last Post: 26th October 2010, 07:07
  2. Building MySQL QT Drivers on Windows XP
    By cia.michele in forum Newbie
    Replies: 6
    Last Post: 16th August 2010, 18:54
  3. Installing QT in windows with mysql drivers
    By roncriss in forum Installation and Deployment
    Replies: 0
    Last Post: 20th November 2009, 03:45
  4. mysql drivers for QT-4.5.2
    By jsmith in forum Qt Programming
    Replies: 1
    Last Post: 31st August 2009, 11:33
  5. Mysql drivers install problems
    By cyberboy in forum Qt Programming
    Replies: 20
    Last Post: 2nd February 2008, 14:11

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
  •  
Qt is a trademark of The Qt Company.