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. connect mysql qt creator 6.8.0
Forum Updated to NodeBB v4.3 + New Features

connect mysql qt creator 6.8.0

Scheduled Pinned Locked Moved Unsolved General and Desktop
14 Posts 3 Posters 1.9k Views
  • 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.
  • J Offline
    J Offline
    Jeferson
    wrote on last edited by
    #1

    Well, I've already consulted the forum, and I saw that many people in the past had difficulty connecting MySQL to QT Creator, and I did too. Could someone help me? I don't understand anything about the platform, it's new to me, but I've been a programmer for a few years and I use Windows 64. I have version 6.8.0, I have installed C:\Program Files\MySQL\MySQL Connector C 6.1, I don't know if it helps, and I work as a local server with XAMPP, I also have Visual Studio 2022 Community installed. Thank you.

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      At https://doc.qt.io/qt-6/sql-driver.html you can read how to build the Qt MySQL plugin.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jeferson
        wrote on last edited by
        #3

        Ola, Meu qt não tem o prompt de comando, instalei todas as versões disponíveis, tudo, e não tem o prompt de comando.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          Hello, My qt does not have the command prompt, I installed all available versions, everything, and it does not have the command prompt.

          You are using Visual Studio and the Microsoft tool chain. If my memory serves, the Microsoft tools installs a Start menu shortcut to launch a command prompt set up for those tools.

          • Open the Microsoft VS developer command prompt (Use the Microsoft C++ toolset from the command line)
          • Run cl.exe (Microsoft's compiler) to test the environment is OK.
          • Execute {qtdir}\6.8.0\msvc\bin\qtenv2.bat to add Qt-specific elements to the environment
          • Run qmake -v to check that you have the correct Qt environment
          1 Reply Last reply
          1
          • J Offline
            J Offline
            Jeferson
            wrote on last edited by
            #5

            obrigado pela atenção, eu fiz o que me sugeriu o resultado foi esse: QMake version 3.1
            Using Qt version 6.8.0 in C:/Qt/6.8.0/msvc2022_64/lib
            qual seria o próximo passo?

            1 Reply Last reply
            0
            • J Offline
              J Offline
              Jeferson
              wrote on last edited by
              #6

              Quando eu executo esse comondo: C:\Qt\6.8.0\Src\configure.bat -sql-mysql -- -DMySQL_INCLUDE_DIR="C:\Program Files\MySQL\MySQL Connector C 6.1\include" -DMySQL_LIBRARY="C:\Program Files\MySQL\MySQL Connector C 6.1\lib\libmysql.lib"
              Ele não reconhece esse arquivo: configure.bat, mas ele existe na pasta.

              C 1 Reply Last reply
              0
              • Christian EhrlicherC Online
                Christian EhrlicherC Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Please write in English or use the appropriate subforum

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                1
                • J Offline
                  J Offline
                  Jeferson
                  wrote on last edited by
                  #8

                  Sorry. Could someone help me? I don't understand anything about the platform, it's new to me, but I've been a programmer for a few years and I use Windows 64. I have version 6.8.0, I have installed C:\Program Files\MySQL\MySQL Connector C 6.1, I don't know if it helps, and I work as a local server with XAMPP, I also have Visual Studio 2022 Community installed. Thanks.

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    Jeferson
                    wrote on last edited by
                    #9

                    Hi, I tested some things from the link that was sent to me above, but it returns this error:
                    -- Configuring incomplete, errors occurred!
                    CMake Error at C:/Qt/6.7.2/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:1077 (message):
                    CMake exited with code 1.

                    1 Reply Last reply
                    0
                    • J Jeferson

                      Quando eu executo esse comondo: C:\Qt\6.8.0\Src\configure.bat -sql-mysql -- -DMySQL_INCLUDE_DIR="C:\Program Files\MySQL\MySQL Connector C 6.1\include" -DMySQL_LIBRARY="C:\Program Files\MySQL\MySQL Connector C 6.1\lib\libmysql.lib"
                      Ele não reconhece esse arquivo: configure.bat, mas ele existe na pasta.

                      C Offline
                      C Offline
                      ChrisW67
                      wrote on last edited by
                      #10

                      This:

                      C:\Qt\6.8.0\Src\configure.bat -sql-mysql -- -DMySQL_INCLUDE_DIR="C:\Program Files\MySQL\MySQL Connector C 6.1\include" -DMySQL_LIBRARY="C:\Program Files\MySQL\MySQL Connector C 6.1\lib\libmysql.lib"

                      looks like you are trying to configure to build all of Qt, not just the Mysql/Mariadb driver. The instructions are here and do not look like what you have done.

                      1 Reply Last reply
                      2
                      • J Offline
                        J Offline
                        Jeferson
                        wrote on last edited by
                        #11

                        It only worked partly because it created a path:
                        C:\Qt\6.7.2\msvc2019_64\plugins\sqldrivers
                        The drive: qsqlmysql.dll
                        It is only connecting in release but not in debug.
                        Could you please continue helping me?

                        Christian EhrlicherC C 2 Replies Last reply
                        0
                        • J Jeferson

                          It only worked partly because it created a path:
                          C:\Qt\6.7.2\msvc2019_64\plugins\sqldrivers
                          The drive: qsqlmysql.dll
                          It is only connecting in release but not in debug.
                          Could you please continue helping me?

                          Christian EhrlicherC Online
                          Christian EhrlicherC Online
                          Christian Ehrlicher
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @Jeferson said in connect mysql qt creator 6.8.0:

                          It is only connecting in release but not in debug.

                          Because you only built the release plugin.

                          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                          Visit the Qt Academy at https://academy.qt.io/catalog

                          1 Reply Last reply
                          1
                          • J Jeferson

                            It only worked partly because it created a path:
                            C:\Qt\6.7.2\msvc2019_64\plugins\sqldrivers
                            The drive: qsqlmysql.dll
                            It is only connecting in release but not in debug.
                            Could you please continue helping me?

                            C Offline
                            C Offline
                            ChrisW67
                            wrote on last edited by
                            #13

                            Probably just requires this is in a fresh build directory

                            qt-cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja ...
                            
                            1 Reply Last reply
                            0
                            • J Offline
                              J Offline
                              Jeferson
                              wrote on last edited by
                              #14

                              Hello, I'm just here to say that I managed to make the connection, and to thank you for your help. Thank you.

                              1 Reply Last reply
                              1

                              • Login

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