Solved Unable to connect to Mysql with release version
-
@JonB said in Unable to connect to Mysql with release version:
QT_DEBUG_PLUGINS=1
Sorry I misunderstood. Thought that was just to diagnos what was missing.
Bonnie, I downloaded it from mysql, its the same one in the minGW directory that works under Creator.
@JonB this worked in diagnosing my issue! Thanks.
So to explain for more newbie people like me:
You put QT_DEBUG_PLUGINS in the project tab on the left and add it to the environment variables and sent the value to 1.Then I launched in debug and everything the program was doing in regards to plugins was verbose in the output.
From this I descerned that it was looking for the qsqlite.dll in the plugins/sqldrivers of the minGW.
The windeploy tool put it just in an sqldrivers folder so I created a plugins folder and moved it there and voila, it worked!!
Thanks:)
Thanks
-
@JonB
So I deployed to another machine and I get the same error.To test on my machine I renamed the QT directory so it was not picking up anything from it and it worked fine. Any idea how to diagnose when its happening on another machine. Other machine is windows 10 as well.
Thanks,
-
@JSher
You have to do the same as before. You don't have to have Qt Creator. E.g. hopefully you can run your app from a Command Prompt:set QT_DEBUG_PLUGINS=1 your-app-exe
-
@JonB said in Unable to connect to Mysql with release version:
set QT_DEBUG_PLUGINS=1
your-app-exeI opened a command prompt and set it and then ran it but nothing appeared in the command promp and the program opened. Am I missing something?
Thanks,
--James -
@JSher
Bearing in mind I have no expereince of this.... I might bet that this post from 2014 for Windows still applies?
https://forum.qt.io/topic/41943/platform-plugin-windows/8hskoglund 31 May 2014, 06:03
Hi, just an update on why QT_DEBUG_PLUGINS=1 doesn't work as expected when you launch a Qt app from the command line (as it does on Linux and Macs): I found that for Windows MSVC and MinGW compilers, Qt routes the texts to OutputDebugString(), that's why the CMD window shows no output.
Instead, to see the output, download "Sysinternal's DbgView":http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
...? :)
Which you'd have to do since it solved you before on your machine. BTW, you did try making the same change on the new machine as you found you had to do on the other machine, didn't you? It wouldn't be surprising if it's the same issue with the same requirement....
-
@JonB Sorry can only reply every 10 minutes":)
Yes I kept all the same files in the same directory. I am about to try on another machine. Dunno why that would make a difference but you never know.
Thanks
--James -
So the strange thing is, it works on 2 other computers....ugg
-
Hi,
One thing you can do is run Dependency Walker on these various machines to check is there's a difference with the dependencies of the MySQL dlls.
-
I found the issue:
It says it cannot find qsqlmysqld.dll. Any reason why it could not load this library? It is an older computer but running windows 10. It finds all the rest and shows the path to where it and the rest it does load in the Module debug.
Thanks,
--James -
@JSher said in Unable to connect to Mysql with release version:
qsqlmysqld.dll
The
d
at the end sounds like this is compiled for debug? You said you did Release build, so I wonder why this is needed at target machine?Meanwhile, read https://bugreports.qt.io/browse/QTBUG-78241
-
Oh I threw a debug version on it to see the module load sequence.
-
I am going to create a new question as this one is technically solved and a new one has popped up..
Thanks,
--James -
@JSher it worked for me as well to put the sqldrivers folder in a plugin folder! thanks you very much !!! :D