Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. issues with building QMYSQL plugin
Forum Updated to NodeBB v4.3 + New Features

issues with building QMYSQL plugin

Scheduled Pinned Locked Moved Solved Installation and Deployment
59 Posts 3 Posters 23.0k Views 2 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #50

    Something strange, the wrong standard is selected. Just tested and it used c++1y

    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
    • mzimmersM Offline
      mzimmersM Offline
      mzimmers
      wrote on last edited by
      #51

      Does your project file look like this?

      TARGET = qsqlmysql
      
      HEADERS += $$PWD/qsql_mysql_p.h
      SOURCES += $$PWD/qsql_mysql.cpp $$PWD/main.cpp
      
      #QMAKE_USE += mysql
      
      OTHER_FILES += mysql.json
      
      PLUGIN_CLASS_NAME = QMYSQLDriverPlugin
      include(../qsqldriverbase.pri)
      

      And do your installed mysql packages look more or less like this?

      dpkg -l | grep '^ii' | grep mysql
      ii  libmysqlclient-dev                    5.5.54-0+deb8u1                      amd64        MySQL database development files
      ii  libmysqlclient18:amd64                5.5.54-0+deb8u1                      amd64        MySQL database client library
      ii  libmysqlcppconn7                      1.1.3-6                              amd64        MySQL Connector for C++ (library)
      ii  libqt5sql5-mysql:amd64                5.3.2+dfsg-4+deb8u2                  amd64        Qt 5 MySQL database driver
      ii  mysql-apt-config                      0.8.3-1                              all          Auto configuration for MySQL APT Repo.
      ii  mysql-common                          5.7.17-1debian8                      amd64        MySQL Common
      ii  mysql-community-source                5.7.17-1debian8                      amd64        MySQL source
      ii  mysql-workbench                       6.2.3+dfsg-7                         amd64        MySQL Workbench - a visual database modeling, administration and queuing tool
      ii  mysql-workbench-data                  6.2.3+dfsg-7                         all          MySQL Workbench -- architecture independent data
      ii  python-mysql.connector                1.2.3-2                              all          pure Python implementation of MySQL Client/Server protocol
      mzimmers@debian:~/QtStuff/qtbase/src/plugins/sqldrivers/mysql$ 
      
      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #52

        Sorry, I was building 5.9 but the project file is the same except that I didn't comment QMAKE_USE in my case.

        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
        • mzimmersM Offline
          mzimmersM Offline
          mzimmers
          wrote on last edited by
          #53

          @SGaist OK, well...this is confounding.

          I've also lost my CLI commands for mysql-client and mysql-server. I think when I was uninstalling, I may have lost a few things. Do you think I should install these?

          mysql-server | 5.5.54-0+deb8u1 | http://security.debian.org/ jessie/updates/main amd64 Packages
          mysql-server | 5.5.54-0+deb8u1 | http://security.debian.org/ jessie/updates/main amd64 Packages
          
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #54

            Yes, otherwise you won't have a MySQL database available on your machine. Note that you don't need it to build the plugin, really just to provide a database to work with.

            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
            • mzimmersM Offline
              mzimmersM Offline
              mzimmers
              wrote on last edited by
              #55

              SGaist: I'm going to re-do my MySQL installations from scratch, using the notes above. One thing I'm not clear on is, why am I using 5.5.54 instead of 5.7.17? Is it compatibility with the plugin source?

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

                AFAIK, 5.5 is the current officially available on jessie. 5.7 is from sid AKA unstable.

                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
                1
                • mzimmersM Offline
                  mzimmersM Offline
                  mzimmers
                  wrote on last edited by mzimmers
                  #57

                  Thank you for all of the help, SGaist. I've got a clean installation of the correct version of mysql on my system now, and I believe I'm building correctly (if I manually modify the compiler flags). When I make, I get a file libqsqlmysql.so in qtbase/plugins/sqldrivers. When I do a make install, I get a copy of this file in /opt/Qt/5.8/gcc_64/plugins/sqldrivers. I believe this is the correct behavior. There's also a copy in tTools/QtCreator/libQt/plugins/sqldrivers. I think this got downloaded with Creator.

                  Oddly, though, the file sizes aren't the same. Does "make install" actually build again, using different compiler options?

                  I'm going to consider this thread resolved. To summarize:

                  1. Make sure you're using the correct version of qmake. Use the full pathname.
                  2. When you install the mysql package, make sure you're getting the correct version.
                  3. If you'll need a local server, install mysql-server. This will automatically give you mysql-client and some other stuff you will likely need at some point.
                  4. In addition to installing mysql-server, you need to install libmysqlclient-dev for some header files.
                  5. If you don't already have them, you need to install zlib1g-dev and libssl-dev as well.
                  6. If you're not doing this as a super-user, you may not have permissions to build in place, and you'll need to make a private copy first. The "make install" command should create a copy in the correct location.
                  1 Reply Last reply
                  2
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #58

                    Just a small thing for number 3, you don't need the mysql-server package if you'll be connecting to a remote server. only libmysqlclient-dev.

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

                    mzimmersM 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Just a small thing for number 3, you don't need the mysql-server package if you'll be connecting to a remote server. only libmysqlclient-dev.

                      mzimmersM Offline
                      mzimmersM Offline
                      mzimmers
                      wrote on last edited by
                      #59

                      @SGaist right you are: I reworded it. Thanks.

                      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