⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testmysql.cpp

📁 一个非常好的GIS开源新版本
💻 CPP
字号:
/***************************************************************************     testmysql.cpp     --------------------------------------    Date                 : Sun Sep 16 12:18:04 AKDT 2007    Copyright            : (C) 2007 by Gary E. Sherman    Email                : sherman at mrcc dot com *************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#include <iostream>extern "C"{#include <mysql.h>}int main(int argc, char **argv){  std::cout << "MySQL connection test" << std::endl;   // init mysql   MYSQL db;  MYSQL *res = mysql_init(&db);  MYSQL *con = mysql_real_connect(&db, "localhost", "gsherman", 0, "test", 0, NULL, 0);  if(con)  {    std::cout << "Connection successful" << std::endl;   }  else  {    std::cout << "Connection failed" << mysql_error(&db) << std::endl;   }  return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -