Home > Database > Mysql Tutorial > C++连接Mysql数据库,mysql_real_connect总是报错:访问内存冲突

C++连接Mysql数据库,mysql_real_connect总是报错:访问内存冲突

WBOY
Release: 2016-06-06 09:39:05
Original
2216 people have browsed it

mysql数据库

C++连接本地Mysql数据库,配置按照网上来的:
c/c++使用VS2013连接mysql数据库
访问数据库的代码也是按照网上来的:

<code> #include <winsock.h>#include <iostream>#include <string>#include <mysql.h>using namespace std;#pragma comment(lib, "ws2_32.lib")#pragma comment(lib, "libmysql.lib")//单步执行,不想单步执行就注释掉#define STEPBYSTEPint main() {    cout name </mysql.h></string></iostream></winsock.h></code>
Copy after login

但是mysql_options总是报错:堆坏损
mysql_real_connect 总是报错:访问内存冲突
肿么破?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template