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. [SOLVED] MySQL driver for Debian
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] MySQL driver for Debian

Scheduled Pinned Locked Moved General and Desktop
12 Posts 3 Posters 3.7k 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.
  • Z Offline
    Z Offline
    Zerby
    wrote on last edited by
    #1

    Hello,

    I need to build the QMYSQL driver for Debian Linux. Somehow I don't have "anything" in my sqldrivers -folder under my QT directory, in the plugins -folder? I had some trouble installing QT in the first place, as seen from this post: http://qt-project.org/forums/viewthread/36677

    How can I download the complite QT package to my Debian machine with all the plugin templates etc. that I have on my Windows machine?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      clochydd
      wrote on last edited by
      #2

      Hi, for me downloading "this ":http://download.qt-project.org/official_releases/qt/5.2/5.2.1/qt-opensource-linux-x64-5.2.1.run worked perfectly and - on another Debian derivate machine, the "online-installer ":http://download.qt-project.org/official_releases/online_installers/qt-opensource-linux-x64-1.5.0-2-online.run made it, too.

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zerby
        wrote on last edited by
        #3

        Thank you for the answer. Unfortunately I cannot used the installers, because I'm running Debian on a virtually hosted machine, without X server (the GUI of Linux). I've tried to run these installers before, and I always get the error message:

        @cannot connect to X server@

        If it's impossible to load the sources for these plugins from Qt, does anyone know if it's possible to build the required MySQL driver for Linux, on a Windows machine? I need the libqmysql.so -file as far as I understand, can I compile the MySQL drivers from my Windows machine and produce the .so file?

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

          Hi,

          It would be quicker to install a virtual machine matching your hosted machine and build what you need in there. Cross-compiling from window to linux is way more complicated.

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

            For the long term, that's probably what I need to do.. Too bad a precompiled driver probably isn't available anywhere on the internet either, for downloading?

            I actually have a Raspberry Pi at home with Debian in it (and X server installed), I guess I could try my luck with that! Won't have too much processing power for compiling, but then again I only need the driver for now :)

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

              One of the problem is that depending on which distribution you have you won't have the same MySQL libraries installed, so you can't create a plugin that works on all platform (and in this case linux distributions)

              Unless your hosted machine also run on ARM you won't be lucky ;)

              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
              • Z Offline
                Z Offline
                Zerby
                wrote on last edited by
                #7

                Well, I downloaded the sources from "here":http://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.tar.gz, and in this .zip the files are actually there. So I extracted them, and ran:

                @qmake "INCLUDEPATH+=/usr/local/include/mysql" "LIBS+=-L/usr/lib/x86_64-linux-gnu -lmysqlclient_r" mysql.pro
                @

                Under my /usr/lib/x86_64-linux-gnu I have the following files:

                @./libmysqlclient_r.so.18.0.0
                ./libmysqlclient_r.so.18
                ./libmysqlclient.so.18
                ./libmysqlclient.so.18.0.0
                ./libmysqlclient.a
                ./libmysqlclient.so
                ./libmysqlclient_r.a
                ./libmysqlclient_r.so
                @

                but after running I get the error:

                @Project ERROR: addExclusiveBuilds() requires at least two arguments
                @

                I can't believe this is so hard..

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

                  What version of Qt are you using to build these sources ?

                  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
                  • Z Offline
                    Z Offline
                    Zerby
                    wrote on last edited by
                    #9

                    Hello,

                    qmake -v gives:

                    @qmake -v
                    QMake version 3.0
                    Using Qt version 5.1.1 in /usr/lib/x86_64-linux-gnu
                    @

                    EDIT: Could it work if I try and find the 5.1.1 sources? Guess there's no harm trying :)

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

                      Indeed, that's what I was about to say. Get the corresponding sources, the build system can be updated from one version to the other.

                      "There":http://download.qt-project.org/official_releases/qt/5.1/5.1.1/single/qt-everywhere-opensource-src-5.1.1.tar.gz they are

                      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
                      • Z Offline
                        Z Offline
                        Zerby
                        wrote on last edited by
                        #11

                        [quote author="SGaist" date="1399363205"]Indeed, that's what I was about to say. Get the corresponding sources, the build system can be updated from one version to the other.

                        "There":http://download.qt-project.org/official_releases/qt/5.1/5.1.1/single/qt-everywhere-opensource-src-5.1.1.tar.gz they are[/quote]

                        Well, after hours of trying, I got it to work :) I had 5.1.1 sources on my Windows machine, so I transfered them to my Linux machine. I only read your message afterwards, I'll probably still update the sources on my Linux from your link aswell later.

                        I needed to modify the includepaths a bit, but I finally got the mysql.pro to compile, and the libqsqlmysql.so produced. And, it worked on my application!

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

                          Rule of thumb: the zip file if for windows and the tar.gz is for unix like OS (line ending stuff)

                          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