Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. QT5.4 embedded mysqld?
Forum Updated to NodeBB v4.3 + New Features

QT5.4 embedded mysqld?

Scheduled Pinned Locked Moved 3rd Party Software
9 Posts 2 Posters 2.9k 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.
  • K Offline
    K Offline
    Komerad
    wrote on last edited by
    #1

    I am overlooking the obvious on this I gues.

    Now, I have mysql working just fine. But I now want to create a stand alone that has its own db and thus required the embedded.

    bq. To use the embedded MySQL server, simply link the Qt plugin to libmysqld instead of libmysqlclient. This bq. can be done by replacing -lmysqlclient_r by -lmysqld in the qmake command in the section below.

    This however seems more suited for unix and macosx.
    Normal compiling on windows does give a qsqlmysql.dll and a qsqlmysqld.dll

    What needs to be done on windows then?

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

      Hi,

      These instructions are valid also for Windows, just rebuild the plugins following them

      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
      • K Offline
        K Offline
        Komerad
        wrote on last edited by
        #3

        I would If I knew what to swap.

        @cd %QTDIR%\src\plugins\sqldrivers\mysql
        qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
        nmake@

        Trying to see a link with the unix line i would look for a libmysqld.lib file wich is not present. So what changes into what to get the proper dll?

        This raises 2 more questions.

        1. Why does compiling mysql outputs libmysql and libmysqld files then if only the libmysql one is usefull?
        2. Does this mean that a program can only use one of each type?
          Only embedded or only external? Not a combination of a local table + a remote one?
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          How did you get MySQL ?

          1. libmysqld should be the embedded server library although the naming scheme is a bit misleading
          2. Yes. It would be like trying to use a table from databases located on two different MySQL servers.

          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
          • K Offline
            K Offline
            Komerad
            wrote on last edited by
            #5

            I have builded the libs with mingw.
            mysql client part is working perfectly.
            Just wondering how to "link(QMYSQL?)" "what(mysqld.dll?)" to move from client to embedded.

            Working on a tool that reads files and process the content into an offline database. For a big part I can reuse a previous tool that has the same concept. I did install and use mysql on the nas there. This tool now can be used by everyone.

            Did not know/expect there would be a limit on using tables from different servers. Handy for offline duty that uses parameters stored in an online table.

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

              Like suggested in the doc link to mysqld rather than mysqlclient_r

              I didn't say there was a limit, but from what I understood of your description you were trying to use tables from the different databases like they were all from the same which is not possible. However you can create several connections and use several databases without any problem.

              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
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                An additional note, if you want to access both embedded and remote MySQL databases at the same time that would require two different MySQL plugins one linked with each library.

                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
                • K Offline
                  K Offline
                  Komerad
                  wrote on last edited by
                  #8

                  Sorry for not seeing it but the docs suggest this for unix/osx.
                  I can't port the suggestion over to windows just like that as for windows there is no "mysqlclient_r" to replace (see the command for compiling on windows.)

                  @cd %QTDIR%\src\plugins\sqldrivers\mysql
                  qmake "INCLUDEPATH+=C:/MySQL/include" "LIBS+=C:/MYSQL/MySQL Server <version>/lib/opt/libmysql.lib" mysql.pro
                  nmake@

                  Thanks for clarifying about the mysql possibilities. Might need it one day.

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

                    The naming is a bit different on Windows

                    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