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