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. MySql Deploy App....HELP!!
Forum Updated to NodeBB v4.3 + New Features

MySql Deploy App....HELP!!

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
28 Posts 3 Posters 8.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.
  • S Offline
    S Offline
    shathcock
    wrote on last edited by
    #1

    Hello this is my first post but I am in dire need of some help. I have created an application in creator using qt 5.5.1 and visual studio 2013. It connects to a remote MySql Database and when I run it from creator it works fine. When I go to the build release directory and run it it works perfectly.....However When I use windepolyqt (I think that is the name of the tool) and to create an installation folder and I run it the app works fine but I get "driver not loaded driver not loaded" error when I try to connect to the database. I do have the qsqlmysql.dll in the sqldrivers folder. I have been working on this for the last 36 hours and can't figure and I desperately need to deploy this to several machines quickly. Any help would be greatly appreciated!!!!!

    1 Reply Last reply
    0
    • hskoglundH Online
      hskoglundH Online
      hskoglund
      wrote on last edited by
      #2

      Hi, I'm guessing, windeployqt is a fine tool but for database programs it forgets to copy Q5Sql.dll, that could be cause of your problem. When starting windeployqt, try adding the -sql switch, like this:
      windeployqt -sql yourapp.exe

      S 1 Reply Last reply
      0
      • hskoglundH hskoglund

        Hi, I'm guessing, windeployqt is a fine tool but for database programs it forgets to copy Q5Sql.dll, that could be cause of your problem. When starting windeployqt, try adding the -sql switch, like this:
        windeployqt -sql yourapp.exe

        S Offline
        S Offline
        shathcock
        wrote on last edited by
        #3

        @hskoglund Thanks for the reply but QT5Sql.dll it did copy QT5Sql.dll into the application directory.

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

          Hi and welcome to devnet,

          Do you also have the MySQL client libraries deployed with your application ?

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

          S 1 Reply Last reply
          0
          • hskoglundH Online
            hskoglundH Online
            hskoglund
            wrote on last edited by
            #5

            Ok. You could try debugging, turn on a trace when Qt loads the plugins.
            Before starting your app, set an environment variable to enable the trace:
            SET QT_DEBUG_PLUGINS=1

            To see the trace output, you can download the DebugView program

            1 Reply Last reply
            0
            • SGaistS SGaist

              Hi and welcome to devnet,

              Do you also have the MySQL client libraries deployed with your application ?

              S Offline
              S Offline
              shathcock
              wrote on last edited by
              #6

              @SGaist I copied the libmysql.dll file into the application directory to no avail and also tried copying it and the libmysel.lib files to the c:\windows directory.

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

                Don't put anything in the windows folder. Next step is what @hskoglund suggested

                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
                • S Offline
                  S Offline
                  shathcock
                  wrote on last edited by
                  #8

                  ok the 3 Lines I see that seem to be the ones in the debug

                  QSalDatabase: QMYSQL driver not loaded
                  QSqlDatabase: available drivers;
                  QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins

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

                    The question is going to be silly but: Are you instantiating a QApplication (or Gui or Core) as the first thing in your main function ?

                    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
                    • S Offline
                      S Offline
                      shathcock
                      wrote on last edited by
                      #10

                      Yeah I am just using the normal Windows Application Setup Which has QApplication a (argc, argv); as the first line then just creates an instance of mainwindow.

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

                        Can you check what QCoreApplication::libraryPaths(); returns ?

                        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
                        • S Offline
                          S Offline
                          shathcock
                          wrote on last edited by
                          #12

                          When I run it from creator it returns the release directory of the release folder that it creates and puts everything into. In other words the directory it puts the .exe file into sorry it's bee a long few days.

                          1 Reply Last reply
                          0
                          • hskoglundH Online
                            hskoglundH Online
                            hskoglund
                            wrote on last edited by
                            #13

                            Hi, one more thing you could try (since your app runs fine when launched from Qt Creator):
                            define the environment variable (SET QT_DEBUG_PLUGINS=1) also in Qt Creator (in the Projects Tab, you can set it in Build Environment) then start your app and compare the trace output to the one you got with errors before.

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              shathcock
                              wrote on last edited by
                              #14

                              Any other Ideas this just really doesn't make any sense. It runs perfectly from the directory that it is compiled to but I can't move it anywhere else and have the MySql drivers working.

                              1 Reply Last reply
                              0
                              • hskoglundH Online
                                hskoglundH Online
                                hskoglund
                                wrote on last edited by
                                #15

                                Here's another: try skipping using windeployqt; instead switch to using manual deployment, use this nice guide

                                S 1 Reply Last reply
                                0
                                • hskoglundH hskoglund

                                  Here's another: try skipping using windeployqt; instead switch to using manual deployment, use this nice guide

                                  S Offline
                                  S Offline
                                  shathcock
                                  wrote on last edited by
                                  #16

                                  @hskoglund Ok tried it Same Thing!!

                                  1 Reply Last reply
                                  0
                                  • hskoglundH Online
                                    hskoglundH Online
                                    hskoglund
                                    wrote on last edited by
                                    #17

                                    Hmmm... The deployment directory/the installation folder your app refuses to run from, is that inside C:\Program Files (x86) or a more normal folder like C:\Qt?

                                    1 Reply Last reply
                                    0
                                    • S Offline
                                      S Offline
                                      shathcock
                                      wrote on last edited by
                                      #18

                                      No I have it on the Desktop I'll try though!!

                                      S 1 Reply Last reply
                                      0
                                      • S shathcock

                                        No I have it on the Desktop I'll try though!!

                                        S Offline
                                        S Offline
                                        shathcock
                                        wrote on last edited by
                                        #19

                                        @shathcock Nope same thing!!!

                                        1 Reply Last reply
                                        0
                                        • hskoglundH Online
                                          hskoglundH Online
                                          hskoglund
                                          wrote on last edited by
                                          #20

                                          Hmmmm, if I understand correctly: you have 2 directories/folders with identical contents but in different places on your C: drive. When you doubleciick to launch your app in one of them everything is fine and dandy, but when you try doubleclicking your app in the other directory you get that mysql plugin loading error?

                                          S 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