QT MYSQL Driver on windows, Visual C++ 2010
-
Ya i know this question in not new here. i really went through numerous topic related to same "driver not loaded driver not loaded". saw YouTube videos too. So i downloaded this file "qt-windows-opensource-5.1.0-msvc2010-x86-offline.exe" and "qt-vs-addin-1.2.2-opensource.exe" as i like to work with vs2010 IDE. my qt installation directory is e:\qt. and i know i have to manually build these drivers. i couldn't find the SRC folder under the qt directory not even under "E:\Qt\Qt5.1.0\5.1.0". So after googling a lil bit i thought i found the solution here "http://www.seppemagiels.com/blog/create-mysql-driver-qt-windows". qt sdk link is not working. please somebody help me with building these drivers. mysql version is 5.5.27 that came with XAMPP package. OS: windows 7.
-
AFAIK offline installers don't contain the source. I might be wrong about that so if I am it will be in the qtbase sub-directory.
Anyway you can download source separately from official repo "here":http://download.qt-project.org/official_releases/qt/5.1/5.1.0/single/
You can also use the online installer if you like to keep everything in one place.BTW. Current version is 5.2.1
-
i have the same problem here, did u found the solution?
-
no. i don't understand this become common problem. this type of post is highlighted many times not just here but also on stackoverflow and similar sites, still why QT made it more complicated.
-
But what is the problem? You can't find Qt source code? Either use online installer or the link I gave you.
-
hey azadsagar check this out!
https://www.youtube.com/watch?v=LhLy-U7uyzQ -
[quote author="Chris Kawa" date="1396369608"]But what is the problem? You can't find Qt source code? Either use online installer or the link I gave you.[/quote]
our problem was "driver not loaded"
-
hi onimusha, i followed youtube video link.
the available sql drivers with my installation are these
QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7still looking for the solution. i have to build these drivers from the source which is really complicated task for me now. coz i can not find proper qt source... one with qtmysql.
-
Guys, what are you talking about? I already gave you one link to "zipped sources":http://download.qt-project.org/official_releases/qt/5.1/5.1.0/single/, You can also download source using "online installer":http://qt-project.org/downloads from main download page or even use the central "git repo":https://qt.gitorious.org/qt/qt/source/68a911862e05400ced87971c43fb27fb5d5d8ebd:src/sql/drivers.
I mean the sources are like all over the place. How can you still miss it?
All SQL drivers are right there in the \Src\qtbase\src\sql\drivers. -
Hi chris, now i am trying some other way to connect to mysql.
so i downloaded mysql odbc connector. my data source name is "sample" with "localhost" as server.
this is how i am trying
QSqlDatabase db=QSqlDatabase::addDatabase("QODBC");please tell me appropriate string to be set with
db.setDataBaseName();odbc connector drivers: MySQL ODBC 5.3 Unicode Driver
-
okay so finally i got the solution but thats just limited to windows.
db.setDatabaseName("Driver={MySQL ODBC 5.3 Unicode Driver};DATABASE=sample");db.open()
worked for me. -
You created the database. How should I know the name of it? It's whatever you named it when you created it.
I think you need to look at some "examples":http://qt-project.org/doc/qt-5/examples-sql.html to get a better grip of SQL with Qt.