Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to install MySQL to (or with) Static Version
Forum Updated to NodeBB v4.3 + New Features

How to install MySQL to (or with) Static Version

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 793 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shokarta
    wrote on last edited by
    #1

    Dear all,

    i know there are some topics about this already, however after two days of trying all i could (mainly I was not aware what Im doing, so maybe i did it wrong), therefore if I can kindly ask you not to link me to other similar topics, please try to give me real example of what to try...

    So at the beginning, I have build stativ version of MinGW 32b, using the script from here and using batch file:

    PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'C:\Qt\windows-build-qt-static.ps1' -QtSrcUrl 'c:\Downloads\From Browser\qt-everywhere-src-5.12.3.zip' -QtStaticDir 'C:\Qt' -MingwDir 'C:\Qt\Tools\mingw730_32' -QtVersion '5.12.3_Static'
    

    basicaly I followed this guide:
    youtube video

    but now I am finding the MYSQL driver is not available in this new static version:
    QSqlDatabase: available drivers: QSQLITE QODBC QODBC3

    I have tried to install new static version modifying the batch file:

    PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'C:\Qt\windows-build-qt-static.ps1' -QtSrcUrl 'c:\Downloads\From Browser\qt-everywhere-src-5.12.3.zip' -QtStaticDir 'C:\Qt' -MingwDir 'C:\Qt\Tools\mingw730_32' -QtVersion '5.12.3_Static_MySQL' -sql-qt-mysql -l mysql -I C:\MySQL\include -L C:\MySQL\lib
    

    however Im getting error:
    C:\Qt\windows-build-qt-static.ps1 : A parameter cannot be found that matches parameter name 'sql-mysql'.
    (i have tride to modify this command with many variants i couild find online (-sql-qt-mysql, -mysql, ...) but still same error...

    So bck to my question,
    please give me suggestion how to install mysql driver into this stable version, or even when it would mean to install the stable version again with mysql in it, then its fine...

    Thank you for every single suggestion for me to try, cause ive been trying to figure out last 3 days with no luck

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What does windows-build-qt-static.ps1 contain ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        What does windows-build-qt-static.ps1 contain ?

        S Offline
        S Offline
        shokarta
        wrote on last edited by
        #3

        @SGaist
        Hello,
        its from the link above, contains this,
        i have only modified line 167 and updated sql parametr to "qt-sqlite" as suggested by every topic and it can be seen on video (otherwise if not done, it gets an error at the beginning that sqlite parameter is unknown)

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          For SQLite you can choose whether you use Qt's bundled version or the one from your system but for the other backends, you have to get the packages for them, hence you only have the -sql-XXX options.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply
          1
          • SGaistS SGaist

            For SQLite you can choose whether you use Qt's bundled version or the one from your system but for the other backends, you have to get the packages for them, hence you only have the -sql-XXX options.

            S Offline
            S Offline
            shokarta
            wrote on last edited by
            #5

            @SGaist

            @SGaist said in How to install MySQL to (or with) Static Version:

            you have to get the packages for them, hence you only have the -sql-XXX options.

            Thanks, this was what I was realy expectiong, but I was hoping to guide me up a little, because what I have tried is to follow this guide:
            https://www.seppemagiels.com/blog/create-mysql-driver-qt5-windows
            but durring that I have few errors when opening mysql.pro in Qt. But following this guide i have only one error of Project ERROR: Library 'mysql' is not defined. which according to bug report it should be fixed by commenting line QMAKE_USE += mysql then no error followed but dlls were not created anyway :(

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              You should also read the MySQL build guide in Qt's documentation. They show the syntax you should use.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved