Qt MySQL driver compilation --- Windows and Linux platforms

Source: Internet
Author: User

1. Windows platform:

Note: The QT installation path is D: \ QT; the MySQL installation path is F: \ mysql
Open a nameorder prompt
1> D: \ QT \ 2010.05 \ QT \ SRC \ plugins \ sqldrivers \ mysql> (switch to this directory)
2> qmake-O makefile "includepath + = F:/MySQL/include" "libs + = F:/MySQL/lib/libmysql. lib "MySQL. pro (note that '/' is not '\')
3> mingw32-make (if not found, add mingw/bin to the environment variable)

If the driver cannot be loaded, run libmysql in F:/MySQL/lib. place the DLL in D: \ QT \ 2010.05 \ QT \ bin. The specific path is determined by the installation path (F:/MySQL/is the MySQL installation path)

2. Linux platform:

1 install MySQL sudo apt-Get install mysql-Server

2 install libmysqlclient15-dev sudo
Apt-Get install libmysqlclient15-dev

3 "CD $ qtdir/src/plugins/sqldrivers/MySQL //Go to the QT directory that stores the MySQL driver source code''

4. qmake "includepath + =/usr/include/MySQL" "libs + =-L/usr/lib/MySQL
-Lmysqlclient_r "mysql. Pro

5 "make

6 "make install

The $ qtdir/plugins/sqldrivers directory contains libqsqlmysql. So, Which is QT.
MySQL driver

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.