Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. MySQL driver isn't installed
Forum Updated to NodeBB v4.3 + New Features

MySQL driver isn't installed

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
15 Posts 4 Posters 1.6k 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.
  • P pierrbt

    @JonB Ok i will try @jsulm advice but, according to me, the command don't work because I configured the plugin as a SQLite one, and the users table exists because i tried the same command in the main MySQL shell and it was working

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #6

    @pierrbt said in MySQL driver isn't installed:

    I configured the plugin as a SQLite one, and the users table exists because i tried the same command in the main MySQL shell and it was working

    But did you create that table in your SQLite database?

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • P pierrbt

      @JonB Ok i will try @jsulm advice but, according to me, the command don't work because I configured the plugin as a SQLite one, and the users table exists because i tried the same command in the main MySQL shell and it was working

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #7

      @pierrbt

      @JonB said in MySQL driver isn't installed:

      there is a QSqlError QSqlQuery::lastError() const to call after the exec().

      ? What's the point of guessing if you have a call to use?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pierrbt
        wrote on last edited by
        #8

        @jsulm I use a MySQL database and, yes i create it. And, it may seem like an obvious question but in the doc you send me, they said to execute a command, so i run that command on the Windows Command Prompt but it return an error :

        C:\Qt\6.2.3\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
        +qtbase cd
        + C:\Qt\6.2.3\Src\qtbase\configure.bat -top-level -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
        -top-level -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>config.opt.in
        'cmake' is not recognized as an internal command
        or external, an executable program or a batch file.
        'cmake' is not recognized as an internal command
        or external, an executable program or a batch file.
        

        And btw, here is the MySQL table config :

        alt text

        jsulmJ 1 Reply Last reply
        0
        • P pierrbt

          @jsulm I use a MySQL database and, yes i create it. And, it may seem like an obvious question but in the doc you send me, they said to execute a command, so i run that command on the Windows Command Prompt but it return an error :

          C:\Qt\6.2.3\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
          +qtbase cd
          + C:\Qt\6.2.3\Src\qtbase\configure.bat -top-level -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
          -top-level -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>config.opt.in
          'cmake' is not recognized as an internal command
          or external, an executable program or a batch file.
          'cmake' is not recognized as an internal command
          or external, an executable program or a batch file.
          

          And btw, here is the MySQL table config :

          alt text

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #9

          @pierrbt said in MySQL driver isn't installed:

          'cmake' is not recognized as an internal command

          You need cmake to build Qt6.

          And I was refering to:
          "I configured the plugin as a SQLite one, and the users table exists because i tried the same command in the main MySQL shell and it was working".
          SQLite != MySQL
          SQLite stores the database in a file, it has absolutelly nothing to do with MySQL.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • P Offline
            P Offline
            pierrbt
            wrote on last edited by
            #10

            I've already installed CMake :

            alt text

            but it don't appear in the build options, have i need to build from a command prompt ?

            And yes i know that MySQL != SQLite but i was just trying to test ...

            jsulmJ 1 Reply Last reply
            0
            • P pierrbt

              I've already installed CMake :

              alt text

              but it don't appear in the build options, have i need to build from a command prompt ?

              And yes i know that MySQL != SQLite but i was just trying to test ...

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #11

              @pierrbt Make sure folder containing cmake executable is in path.
              On Windows you also should execute batch script which prepares the build environment (it should be in the Qt start menu entry and in Qt installation folder). Which one depends on your compiler: either the one for MinGW or MSVC.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              P 1 Reply Last reply
              0
              • jsulmJ jsulm

                @pierrbt Make sure folder containing cmake executable is in path.
                On Windows you also should execute batch script which prepares the build environment (it should be in the Qt start menu entry and in Qt installation folder). Which one depends on your compiler: either the one for MinGW or MSVC.

                P Offline
                P Offline
                pierrbt
                wrote on last edited by pierrbt
                #12

                @jsulm I maybe found : i was coding my app in a "Empty qmake Project", it's maybe the reason why it wasn't working. I'm actually trying to copy the old scripts to the new Project.

                EDIT : And by the way, which compiler should i use, MSVC, MinGW or WebAssembly @jsulm ?

                jsulmJ 1 Reply Last reply
                0
                • P pierrbt

                  @jsulm I maybe found : i was coding my app in a "Empty qmake Project", it's maybe the reason why it wasn't working. I'm actually trying to copy the old scripts to the new Project.

                  EDIT : And by the way, which compiler should i use, MSVC, MinGW or WebAssembly @jsulm ?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #13

                  @pierrbt said in MySQL driver isn't installed:

                  And by the way, which compiler should i use, MSVC, MinGW or WebAssembly @jsulm ?

                  That's up to you.
                  WebAssembly is for applications running in a browser.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    pierrbt
                    wrote on last edited by pierrbt
                    #14

                    @jsulm Ok, i've finally installed CMake and the project is working, the MySQL plugin still doesn't work but it will be easier to repair it ( i hope ).

                    Here is my project :
                    alt text

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      pierrbt
                      wrote on last edited by
                      #15

                      @jsulm I finally fix my problem, I replaced lots of DLLs of the MySQL and MinGW folders using that repository and it finally work ! The MySQL Driver is detected by the compiler and I can perfectly use it. I tried to made that command :

                      INSERT INTO users (pseudo, mail, birthdate, passwd) 
                      VALUES ("pierrbt",
                              "haha@gmail.com",
                              "2000-01-01", 
                              "testPassword");
                      

                      and it's working. Thanks for helping me to fix that problem.

                      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