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. Qt 5 Connection to database MySQL don't work ?
QtWS25 Last Chance

Qt 5 Connection to database MySQL don't work ?

Scheduled Pinned Locked Moved General and Desktop
sqlmysqlmysql 64bitqt5.4qt 5.4.2
8 Posts 5 Posters 3.6k 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.
  • islam ouahoudaI Offline
    islam ouahoudaI Offline
    islam ouahouda
    wrote on last edited by islam ouahouda
    #1

    Hey all, I am working on a PDA management desktop application using Qt 5 and I have a problem my qt connection to mysql database didn't work and i used all the examples that i found but it didn't work please can you please help me , thanks those are the images from my desk

    image 1 : http://www.5zn.cc/files/upfilefile/gesutusers/2015/07/30/1438275493Untitled.png
    image 2 : http://www.5zn.cc/files/upfilefile/gesutusers/2015/07/30/1438275493Untitled2.png

    thanks regards

    R M 2 Replies Last reply
    0
    • N Offline
      N Offline
      NoobProgrammer
      wrote on last edited by NoobProgrammer
      #2

      Hey, did you put "libmysql.dll" into the build location of your Qt project?

      Ideally, you can dynamically link it in your .pro. But, the quick solution is

      1. Find the "libmysql.dll" in your MySQL install location.
      2. Locate the build location of your Qt project which is usually at "build-(your project name)/debug" or "build-(your project name)/release"

      Copy the "libmysql.dll" to the location and then run your project again.

      If this does not fix it, let me know what error message it gives you this time.

      1 Reply Last reply
      1
      • islam ouahoudaI Offline
        islam ouahoudaI Offline
        islam ouahouda
        wrote on last edited by
        #3

        @NoobProgrammer said:

        libmysql.dll

        yes i copy it to the project folder but it's still not ok

        that the new error :
        :-1: error: LNK1104: impossible d'ouvrir le fichier 'libmysql.lib'

        1 Reply Last reply
        0
        • islam ouahoudaI Offline
          islam ouahoudaI Offline
          islam ouahouda
          wrote on last edited by
          #4

          thanks for your reply :)

          1 Reply Last reply
          0
          • islam ouahoudaI Offline
            islam ouahoudaI Offline
            islam ouahouda
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi and welcome to devnet,

              You need to add the path to libmysql.lib to your project DIR variable.

              Out of curiosity, why do you link against this library ? Or are you building the MySQL plugin ?

              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
              • islam ouahoudaI islam ouahouda

                Hey all, I am working on a PDA management desktop application using Qt 5 and I have a problem my qt connection to mysql database didn't work and i used all the examples that i found but it didn't work please can you please help me , thanks those are the images from my desk

                image 1 : http://www.5zn.cc/files/upfilefile/gesutusers/2015/07/30/1438275493Untitled.png
                image 2 : http://www.5zn.cc/files/upfilefile/gesutusers/2015/07/30/1438275493Untitled2.png

                thanks regards

                R Offline
                R Offline
                Rutger7
                wrote on last edited by
                #7

                @islam-ouahouda Problems with Dynamic Load Libraries are sometimes difficult to solve. The reasons can be quite different: due you use the correct version of the libraries, is the path to all the libraries correct or can the application find the library, etc. You can use the Dependency Walker from dependencywalker.com to find link errors between your application and libraries, or from libraries to other libraries. Please note the comment from SGaist: the Qt 5.4 and Qt 5.5 comes with the precompiled qsqlmysql.dll (release) and qsqlmysqld.dll (debug). The only other library you will need is libmysql.dll (note: dll at the end). If you put this last library next to your application it should work.

                1 Reply Last reply
                1
                • islam ouahoudaI islam ouahouda

                  Hey all, I am working on a PDA management desktop application using Qt 5 and I have a problem my qt connection to mysql database didn't work and i used all the examples that i found but it didn't work please can you please help me , thanks those are the images from my desk

                  image 1 : http://www.5zn.cc/files/upfilefile/gesutusers/2015/07/30/1438275493Untitled.png
                  image 2 : http://www.5zn.cc/files/upfilefile/gesutusers/2015/07/30/1438275493Untitled2.png

                  thanks regards

                  M Offline
                  M Offline
                  Maxim DC
                  wrote on last edited by
                  #8

                  @islam-ouahouda Try this, http://seppemagiels.com/blog/create-mysql-driver-qt5-windows it worked for me

                  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