//由于找不到mysqllib.dll,无法继续执行代码
//但是mysqllib.dll存在
#include "stdafx.h"
#include <WinSock2.h> /*socket通信,系统头文件*/
#include <windows.h>
#include <stdio.h>
#include "mysql.h"
#pragma comment(lib, "libmysql.lib")
int main()
{
MYSQL *conn;
const char *server = "localhost";
const char *user = "root";
const char *password = "root";//“******”为你设置的密码
const char *database = "CRM";
conn = mysql_init(NULL);
if (!mysql_real_connect(conn, server, user, password, database, 0, NULL, 0))
printf("连接失败:%s", mysql_error(conn));
else
printf("连接成功!");
getchar();
return 0;
}
终于解决了
只要将mysqllib.d复制到 项目\x64\Debug 之中就完美解决