mysql for Qt on ubuntu
Can someone please explain how to build mysql into qt? The 4.7.4 help says to qmake mysql.pro, but I don’t have this file after an offline install of the sdk. It doesn’t exist.
Welcome to the forum!
There has been a similar post here :
Also when you click on the tag on the right of your post you will find all information concerning mysql including wiki pages.
The problem that I have been having is that after building the libqsqlmysql.so file, I still can’t get Qt to recognize that the MYSQL driver is available. I have added LIBS += -lqsqlmysql to my project’s .pro file, as well as a LIBS += -L/…. to point to where the .so file is located. The project links correctly, but gets a runtime error saying that SQLITE is the only available database.
I have mysql client, server, and dev files installed, and I built the qt mysql driver using these. Is there some location that the driver must be placed in order for Qt to find it. Or perhaps I didn’t build it correctly with the ./configure command. Should it be “static”? Should I build both the lib and the plugin?
I’ve read just about every thread on qt with mysql that’s in the forum and none of the solutions have worked yet…
Did you ever get it to work?
I having it working with Ubuntu Studio 11.04 installed from the Repos, version 4.7.2; but never did get it to work from the SDK; the plugin is copied into the plugin folder; I know that MySQL is working; it works find in the installed version; just not the SDK version.
I tried compiling; but didn’t see that it created creator; I know that is a separate issue; but it keep me from testing it; but I did copy the plugin which it created; still with no help.
Hi, I was also having the same problem. But I figured it out with some easy steps. You can actually install the qt-mysql library from Ubuntu’s Synaptic Package manager. and move it to the folder where you Qt program is looking for libraries.
I’ve written in my blog about it, if you have any doubt you can refer the following link Qt MySQL Driver for Linux [techieshome.in]