Results 1 to 5 of 5

Thread: building a mysql dll in QT to connect to a database

  1. #1
    Join Date
    May 2020
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default building a mysql dll in QT to connect to a database

    Hi !
    I need a step by step how to compile the SQL driver to connect to my online MySql db. The idea is to compile a DLL which I copy to the working directory so the application will be able to use QMYSQL to connect with my online db.

    The online documentation ( https://dev.to/f1r361rd/how-i-build-...s-mingw32-2kim ) and forums did not helped much . In the information i found online i noticed that most people downloaded qmysql.dll, and use that file to be able to get QMYSQL loaded.

    Qt Code:
    1. QStringList sql_drivers = QSqlDatabase::drivers();
    2. sql_drivers.contains("QMYSQL") -> true
    To copy to clipboard, switch view to plain text mode 

    But that dll is version dependent , so i hope there is a solution to get this working on all versions of QT application i make in the future.

    Already spend many hours searching on forums and talked with other software engineers . Most people seems to get not much further then searching for a compiled dll ... After spending 10+ hours trying every post i see, i still have no clue about the basic steps, the internet is scattered with too much information which is contra productive in this case, so i really seek for a simple step by step solution, tearing this thing apart to it becomes clear how it works. No one liners please. Many people will be helped with the answer to this post ! if it take too much time to write down the solution, I’m happy to send a financial compensation.

    If there are simpler solutions, please let me know too

    Thank you Steve

  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: building a mysql dll in QT to connect to a database

    Did you follow these instructions? (If you are using Qt6, select that from the version dropdown list on the left of the page).

    Do you have the appropriate MySQL connector package installed?
    <=== 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
    Jun 2012
    Location
    Austria
    Posts
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: building a mysql dll in QT to connect to a database

    As d_stranz said...
    AND you need the mysql dev files installed on your machine, of course. On linux you need the packages libmariadb-dev and libmariadbclient-dev - no idea what the Windows counterpart is.

  4. #4
    Join Date
    May 2020
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: building a mysql dll in QT to connect to a database

    I never used command line to build, I always use the IDE, so i could really use some help

  5. #5
    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: building a mysql dll in QT to connect to a database

    I'm a Windows / Visual Studio developer myself and don't have too much familiarity with either linux or Qt Creator. Maybe one of the linux gurus here could give you some advice.
    <=== 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. Connect to remote MySQL database using SSH
    By _Dron_ in forum General Programming
    Replies: 6
    Last Post: 7th February 2016, 01:41
  2. How to Connect to MySQL database
    By johnL in forum Newbie
    Replies: 12
    Last Post: 16th May 2015, 17:43
  3. Secure way to connect to MySQL database
    By KeineAhnung in forum Newbie
    Replies: 4
    Last Post: 30th March 2015, 13:49
  4. Function to connect to a MySQL database
    By graciano in forum Qt Programming
    Replies: 0
    Last Post: 14th December 2013, 17:36
  5. Cannot connect to mysql database
    By phapha in forum Newbie
    Replies: 3
    Last Post: 27th October 2011, 15:58

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.