A/C + + connection MySQL Database

Source: Internet
Author: User

This document is about how to use the MySQL API to connect to the MySQL database, the development environment for VS2013.

Development environment settings:

Determine the following two locations first

mysql.h Location: C:\software\wamp\bin\mysql\mysql5.5.20\include

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/FC/wKioL1YLpi3BfVkFAAOFsizaBzw575.jpg "title=" 1.png " alt= "Wkiol1ylpi3bfvkfaaofsizabzw575.jpg"/>

Libmysql.lib Location: F:\mysql\mysqllib

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/FF/wKiom1YLpi_CcmdJAAEA4_tYQ34864.jpg "title=" 2.png " alt= "Wkiom1ylpi_ccmdjaaea4_tyq34864.jpg"/>

You need to point the header file path and the connection library path in the VS2013 project to the top two places:

Point to the c/c++-> general, additional include directory for the Project property page: C:\software\wamp\bin\mysql\mysql5.5.20\include

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/FF/wKiom1YLpkbB4QriAAJie6PWW8E418.jpg "title=" 3.png " alt= "Wkiom1ylpkbb4qriaajie6pww8e418.jpg"/>

To add an additional library directory, general, linker, project property pages, point to: F:\mysql\mysqllib

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/FC/wKioL1YLpnWw1xlGAAKHjUuxdJY049.jpg "title=" 4.png " alt= "Wkiol1ylpnww1xlgaakhjuuxdjy049.jpg"/>

the linker - input - Add in Additional dependencies Libmysql.lib .

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/FF/wKiom1YLpnjiBMRsAAJEXRBU7tE492.jpg "title=" 5.png " alt= "Wkiom1ylpnjibmrsaajexrbu7te492.jpg"/>

need to put Libmysql.dll put it on the project Debug in the folder

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/FC/wKioL1YLpp-gKvmIAADI4Mzbcr4603.jpg "title=" 6.png " alt= "Wkiol1ylpp-gkvmiaadi4mzbcr4603.jpg"/>

Otherwise, the following error will occur:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/FC/wKioL1YLpq3SkDURAABTNARgtPI783.jpg "title=" 7.png " alt= "Wkiol1ylpq3skduraabtnargtpi783.jpg"/>


This article is from the "MySQL" blog, be sure to keep this source http://wenjing.blog.51cto.com/5908329/1699619

A/C + + connection MySQL Database

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.