Results 1 to 4 of 4

Thread: cannot connect to mysql in QT 4.7.2

  1. #1
    Join Date
    Jul 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question cannot connect to mysql in QT 4.7.2

    hi
    im beginner in QT!!!
    and i have a problem with connecting to mysql
    i install offline QT and use ubuntu 11.04

    i downloaded QT SDK from here:
    http://qt.nokia.com/downloads/sdk-li...it-cpp-offline
    but it has not QMYSQL driver in defaults!

    when run my program, show this error:

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


    i have problems with drivers. my error log tells that i only have QSQLITE driver for databases.
    What should I do to configure QMYSQL?
    please step by step!!!

  2. #2
    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 Re: cannot connect to mysql in QT 4.7.2

    This is a step-by-step how to install MySQL driver for Qt: http://doc.qt.io/qt-4.8/http://qt-project.org/doc/qt-4.8/sql-driver.html#qmysql

  3. #3
    Join Date
    Jul 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Maemo/MeeGo

    Default Re: cannot connect to mysql in QT 4.7.2

    I have followed that "step-by-step" to try to get the mysql to work but no joy. I've also done what some other post/forum I found by googling: Installing the mysql library from ubuntu repo, and the qtcreator from ubuntu repo aswell. Same problem only if I install from repo the qtcreator don't know what harmattan/simulator is...

    Maybe someone here can help me troubleshoot?

    I ran the ./configure -qt-sql-mysql -I/usr/include/mysql


    I don't know if that is the correct include-path, but these are the headers present in that directory:

    dlpt@dlpt:/usr/include/mysql$ ls
    decimal.h my_dbug.h mysqld_ername.h plugin_ftparser.h
    errmsg.h my_dir.h mysqld_error.h plugin.h
    keycache.h my_getopt.h mysql_embed.h sql_common.h
    m_ctype.h my_global.h mysql.h sql_state.h
    m_string.h my_list.h mysql_time.h sslopt-case.h
    my_alloc.h my_net.h mysql_version.h sslopt-longopts.h
    my_attribute.h my_pthread.h my_sys.h sslopt-vars.h
    my_compiler.h mysql my_xml.h typelib.h
    my_config.h mysql_com.h plugin_audit.h

    I still get the "
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE"- messages from Qtcreator...

    so, shooting some questions:

    * Is there something I must do more to get mysql to work with Nokia n9 simulator, or on harmattan target?
    * What is the name of the file needed for mysql? Got libqsqlmysql.so in various places, /usr/local/Trolltech/Qt-4.8.2/lib is one.
    * Is there some way to troubleshoot?


    Rgds

  4. #4
    Join Date
    May 2011
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Smile Re: cannot connect to mysql in QT 4.7.2


Similar Threads

  1. [URGENT] How to connect MySQL with Qt 4.7.3?
    By codeartist in forum Qt Programming
    Replies: 6
    Last Post: 26th May 2012, 14:36
  2. Replies: 13
    Last Post: 17th June 2011, 17:19
  3. How to connect Qt with MYSQL??
    By Gokulnathvc in forum Newbie
    Replies: 10
    Last Post: 24th March 2011, 00:52
  4. Qt connect different MySQL
    By weixj2003ld in forum Qt Programming
    Replies: 0
    Last Post: 5th August 2009, 08:35
  5. How to connect MySQL with QT
    By diego in forum Qt Programming
    Replies: 0
    Last Post: 27th May 2009, 05:34

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.