PDA

View Full Version : how can I use connector/odbc driver or any appropriate driver for connecting mysql 5



rahulvishwakarma
3rd November 2014, 17:07
Hi to all,

I'm new to and using Qt5.3.1 in Windows 7 and database as mysql ( server and
workbentch). I'd searched lot of websites and in Qt Documentation, but got no idea

how to connect Qt with database. In some Qt documents I found :-


How to Build the ODBC Plugin on Windows

The ODBC header and include files should already be installed in the right

directories. You just have to build the plugin as follows:

cd %QTDIR%\src\plugins\sqldrivers\odbc
qmake odbc.pro
nmake

If you are not using a Microsoft compiler, replace nmake with make in the line

above.


and not found any nmake.exe or make.exe in these PATHs:-


C:\Qt\Qt5.3.1\Tools\mingw482_32\bin

C:\Qt\Qt5.3.1\5.3\mingw482_32\bin


I found plugin directory only in following path :-


C:\Qt\Qt5.3.1\5.3\Src\qtbase\src\plugins\sqldriver s

When I compile ...\src\plugins\sqldrivers\odbc\odbc.pro
error was "can not find the executable, please specify one"


and in the path :-


C:\Qt\Qt5.3.1\5.3\Src\qtbase\src\plugins\sqldriver s\build-odbc-

Desktop_Qt_5_3_MinGW_32bit-Debug

there is not any executable or dll file.


but found these (in PATH "C:\plugins\sqldrivers") :-
- libqsqlodbc.a
- libqsqlodbcd.a
- qsqlodbc.dll
- qsqlodbcd.dll

but what to do with these. I tried as pasting these DLLs in "C:\windows\system32\"
and "C:\windows\sysWOW64\"

but again foud error :
"driver not loaded diver not loaded"

and when I compile
...\src\plugins\sqldrivers\mysql\mysql.pro
in file "C:\Qt\Qt5.3.1\5.3\Src\qtbase\src\sql\drivers\mysql \qsql_mysql_p.h:63:

error: mysql.h: No such file or directory
#include <mysql.h>
^


Please tell me how to connect mysql and Qt5.3.1 using connector/odbc driver.