Results 1 to 4 of 4

Thread: connect MySQL to Qt

  1. #1
    Join Date
    Mar 2018
    Posts
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default connect MySQL to Qt

    hello guys can someone help me please, i'm trying to connect my database to qt but everytime i compile ther is this ibformation that pop up :
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
    Failed to connect to database.

    i seached on google but no solutions worked for me can someone please help me, it's an assignment due tomorrow.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: connect MySQL to Qt

    You need to find a MySQL DLL / shared library for your platform. Qt supplies only the Qt-side of things; it uses a MySQL run-time library for the other half. The reason your Qt driver won't load is that this MySQL driver isn't present in the same directory as the Qt driver (or reachable on your system PATH).

    Maybe next time you should try starting work on your assignments a bit earlier...
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Mar 2018
    Posts
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: connect MySQL to Qt

    Actually i started earlier but the teacher give us some last changes at the end so... Anyway thank you for your kind advice and the solution that's the only thing that hold me back

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: connect MySQL to Qt

    but the teacher give us some last changes at the end so...
    LOL - Good training for the real world, just change "teacher" to "customer"
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 5
    Last Post: 27th January 2014, 23:22
  2. Replies: 13
    Last Post: 17th June 2011, 18:19
  3. How to connect Qt with MYSQL??
    By Gokulnathvc in forum Newbie
    Replies: 10
    Last Post: 24th March 2011, 01:52
  4. Qt connect different MySQL
    By weixj2003ld in forum Qt Programming
    Replies: 0
    Last Post: 5th August 2009, 09:35
  5. How to connect MySQL with QT
    By diego in forum Qt Programming
    Replies: 0
    Last Post: 27th May 2009, 06:34

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.