Home  >  Article  >  Database  >  控制台-vs2015连接mysql数据库问题??

控制台-vs2015连接mysql数据库问题??

WBOY
WBOYOriginal
2016-06-06 09:34:511206browse

mysql控制台

将libmysql.dll放到了执行文件exe相同的地方了,mysql的include和lib都在工程属性里改好了,但是程序执行后并没有输出任何东西????
win32控制台程序:

<code> #include "stdafx.h"     #include<winsock.h>           //定义socket#include<iostream>#include"mysql.h"#pragma comment(lib,"libmysql.lib")          //此句和在附加依赖项中添加mysql.lib  的功能一样using namespace std;int main(){    MYSQL mysql;    mysql_init(&mysql);    if (mysql_real_connect(&mysql, "localhost", "root", "", "course", 8080, 0, 0)) {        cout </iostream></winsock.h></code>
Statement:
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