Step-by-step development of QT under Windows
Starting today to install MySQL, read some of the MySQL installation blog, the method is roughly the same, but the details of the problems encountered different, or not comprehensive, the following is a personal installation process and problems encountered.
1, first download, MySQL official website: http://www.mysql.com/downloads/installer/
2, installation, you will be prompted to install. NETFRAMEWORK4 environment, here is a download link: http://dldx.csdn.net/fd. PHP?I=537939463366842&S=17682A85274604196D6C02560D3E410C, the information is very good, thanks to the blogger's share ~
3, follow the prompts step by step installation, I started to choose is develop mode, http://blog.csdn.net/xw_hit/article/details/6127992 above, to choose Custom, later changed back to Custom mode, Here is not to say that the develop mode, which reason did not understand, and did not try, here or first choose Custom mode
4. Set the environment variables after the installation is complete.
My Computer-Properties-advanced-environment variables-System Variables-path add: C:\Program files\mysql\mysql Server 5.5\bin
5, compile QT under MySQL driver, also need to download a dynamic library format conversion tool, the URL is: http://www.qtcn.org/download/ Mingw-utils-0.3.tar.gz, unzip the inside Bin directory in the Remip.exe copy to MinGW Bin directory can be used
- CD C:\Program files\mysql\mysql Server 5.5\lib//There are libmysql.dll and other files, some in the opt file, according to personal circumstances
- Reimp-d Libmysql.lib
- Dlltool-k-D libmysql.def-l LIBMYSQL.A
This compiles into a LIBMYSQL.A file, the following to compile the MySQL plugin under QT
- CD%qtdir%/src/plugins/sqldrivers/mysql
- Qmake-o Makefile "Includepath+=c:/include" "LIBS+=C:/LIB/LIBMYSQL.A" Mysql.pro//Here The path can not have spaces, in order to solve this problem, the individual is to put C \ Program Files\mysql\mysql Server 5.5\ the lib and include files are copied to the C: root directory, so that the compilation is not a problem
- Mingw32-make//Generate libqsqlmysqld4.a and Qsqlmysqld4.dll two files
Copy the generated libqsqlmysqld4.a and Qsqlmysqld4.dll to qtdir/plugins/sqldrivers/. Personal in this place churn for a long, finally saw a blog post http://blog.csdn.net/xw_hit/article/details/6127992 Last, let me enlightened, Suddenly, O (∩_∩) o haha ~, The author describes this (I just modified the path):
Although the build succeeds, but still prompts Qsqldatabase:qmysql driver not loaded error, we need to copy the LibmySQL.dll file under the C:/mysql/lib directory to our Qt Creator in the Qt/bin directory under the installation directory .
http://blog.csdn.net/styyzxjq2009/article/details/8131917
Under Window Qt compiled MySQL driver (actually used the dynamic library format conversion tool)