Connector/c++库的源文件编译,你需要先准备好以下工具:
    mysql数据库(编译时要依赖),boost库,cmake(生成sln工程文件),connector/c++的源文件,visual stdio 2003版本以上。例子使用vs2010。
 
一、mysql数据库安装:
1.先安装windows下,建议去官服下载 install 版本。 zip版其实和 install一样的。但zip版要大多了。
下载链接:http://dev.mysql.com/downloads/windows/installer/  下面有个 Select Platform: 的选项,不过要翻墙才能选。
 
2.把mysql安装目录下的 bin目录,加入环境变量。
  1.mysql目录下的 my-default.ini  为参考,修改 my.ini文件。下面的是参考:
  

[client]
password =
port =
socket = /tmp/mysql.sock [mysqld]
basedir=C:/Program Files/MySQL/MySQL Server 5.6
datadir=C:/Program Files/MySQL/MySQL Server 5.6/data
log-error=C:/Program Files/MySQL/MySQL Server 5.6/log/mysql.log
port =
socket = /tmp/mysql.sock
  2. 控制台(cmd)输入:
mysqld --install MySQL --defaults-file="C:\Program Files\MySQL\MySQL Server 5.6\my.ini"
  3. 启动服务: 
net start MySQL   //net start MySQL 可能会提示 1067错误,就是配置错误。有时会出现,有时没有。按网上的建议,没弄没白规律

   net start MySql 只需要第一次启动执行。以后开机后,会自动启动服务。可以去

  ps:关闭并删除服务命令:

net stop MySQL
sc delete MySQL

附官服的启动说明:

User Comments

Posted by Paolo Lancelli on October 24 2007 2:56pm [Delete] [Edit]

In case you receive "The system cannot find the file specified", remember that you have to install the service with the absolute path, in my case "C:\mysql\bin\mysqld --install". I added the \bin to the windows path, and I was installing the service only with "mysqld --install".

Posted by Junaid Nazir on December 29 2007 9:14pm [Delete] [Edit]

As mentioned earlier by another user, I fell into the trap of adding MySQL to start as a service via a command like

C:\> mysqld --install

The service is reported as being installed successfully, however, under the Services panel it shows the executable path as 'C:\mysqld' when in fact it is located under 'C:\mysql\bin'. I was working under the assumption that the mysql\bin directory had been added to the system PATH variable, but really you need to use absolute file paths when installing services. In my case, I used;

C:\> C:\mysql\bin\mysqld --install MySQL --defaults-file=C:\mysql\my.ini

This starts the service automatically with Windows bootup, and will load the my.ini configuration file which you have to place within the mysql directory. For the first time however, you will need to start the mysql service manually, since the earlier command makes mysql start and end with windows shutdowns and restarts.

net start mysql

Posted by bob eff on June 8 2008 4:16am [Delete] [Edit]

If you have problems installing the service on Windows Vista, just run the normal install and add the service manually with the following command:

use the sc create command in a dos window to add the service:

sc create MySQL start= auto DisplayName= MySQL binPath= c:\program files\mysql\mysql server 5.1\bin\mysqld.exe

then if you need to alter any parameters, use the administrative tools/services utility

Posted by Baruch Atta on January 14 2010 5:49pm [Delete] [Edit]

Another "got-ya"... Make sure your my.ini file is in your MySQL directory, and the variables are pointing to the correct directories.

Posted by Rich Wingerter on July 5 2011 3:09am [Delete] [Edit]

In order to overcome the "The system cannot find the file specified" message, I had to use the short 8dot3 names because my command program would not take the long names in quotes. Since I have mysql installed under EasyPHP on the D: drive, I had to use:

D:\progra~2\easyph~1.0\mysql\bin\mysqld --install

to get to mysqld in

D:\Program Files (x86)\EasyPHP-5.3.6.0\mysql\bin

You can get the short names with the directory command:

DIR /X

 
 

MySql C++调用库Connector/c++编译 和 接口封装【一】mysql数据库安装的更多相关文章

  1. MySql C++调用库Connector/c++编译 和 接口封装【二】Connector/c++编译

    二.Connector/c++库的编译:     1.把MySql数据库安装完成后,把bin目录加入环境变量.          2.下载boost库,官网就有下载: http://www.boost ...

  2. MySql C++调用库Connector/c++编译 和 接口封装【三】Connector/c++ 使用总结及封装

    工程需要加上各个路径: 库使用需要几个文件: 1.include 文件夹 c/c++ /常规/附加包含目录 Connector/c++ 的安装版里面的Include 文件夹.或者把 /driver以及 ...

  3. MySQL 官方测试库

    MySQL 官方测试库 github 地址 https://github.com/datacharmer/test_db MySQL 文档地址 https://dev.mysql.com/doc/em ...

  4. MySql UDF 调用外部程序和系统命令

    1.mysql利用mysqludf的一个mysql插件可以实现调用外部程序和系统命令 下载lib_mysqludf_sys程序:https://github.com/mysqludf/lib_mysq ...

  5. MySQL 实现调用外部程序和系统命令

    MySQL 实现调用外部程序和系统命令 Refer:http://www.cnblogs.com/yunsicai/p/4080864.html1) Download lib_mysqludf_sys ...

  6. 友盟推送 .NET (C#) 服务端 SDK rest api 调用库

    友盟推送 .NET SDK rest api 介绍 该版本是基于友盟推送2.3版本封装的,网上查询了下发现没有.NET版本的调用库,官方也没有封装.NET的版本,只有python.java.php版本 ...

  7. 信鸽推送 .NET (C#) 服务端 SDK rest api 调用库(v1.2)

    信鸽推送 .NET  服务端 SDK rest api 调用库-介绍 该版本是基于信鸽推送v2版本的时候封装的,先拿出来与大家分享,封装还还凑合,不依赖其他http调用件,唯一依赖json序列化dll ...

  8. Mysql存储过程调用

    mysql存储过程实例教程 发布时间:2014-04-09编辑:JB01 这篇文章主要介绍了mysql存储过程的使用方法,mysql存储过程实例教程,有需要的朋友参考下.   1.1create  p ...

  9. J2EE之oracle、mysql存储过程调用

    最近几天在研究hibernate.JPA对存储过程的调用,主要是针对有返回结果集的存储过程的调用方法,个人感觉存储过程是个好东西,虽然说heibernate对数据访问封装的比较不错,再加上他的缓存机制 ...

随机推荐

  1. Error_Unix Shell_syntax error near unexpected token `fi'

    2014-06-19 BaoXinjian 1. Issue 调用如下Shell脚本时出现错误syntax error near unexpected token `fi'

  2. 进程控制块PCB结构 task_struct 描述

    注:本分类下文章大多整理自<深入分析linux内核源代码>一书,另有参考其他一些资料如<linux内核完全剖析>.<linux c 编程一站式学习>等,只是为了更好 ...

  3. hdu 4971/ 2014多校/最大权闭合图

    题意:n个项目(每一个相应获得一定价值).m个技术问题(每一个须要支出一定价值),每一个项目必须要攻克若干个技术问题.技术难题之间有拓扑关系. 关键是建图.一看,第一感觉就是最大权闭合图,马上建好了图 ...

  4. 在T-SQL语句中访问远程数据库

    1.启用Ad Hoc Distributed Queries 在使用openrowset/opendatasource前搜先要启用Ad Hoc Distributed Queries服务,因为这个服务 ...

  5. 【iOS开发-56】案例BUG:button的enabled、控件的userInteractionEnabled以及两种提示框UIAlert和UIActionSheet

    接上述案例找BUG:[iOS开发-51]案例学习:动画新写法.删除子视图.视图顺序.延迟方法.button多功能使用方法及icon图标和启动页设置 (1)BUG:答案满了就不能再点击optionbut ...

  6. Yii2 mongodb 扩展的where的条件加入大于小于号浅析(转)

    1. mongodb的where中有比较丰富的 条件,如下: static $builders = [ 'NOT' => 'buildNotCondition', 'AND' => 'bu ...

  7. java各种数据类型之间的转换

    1如何将字串 String 转换成整数 int?   A. 有两个方法:   1). int i = Integer.parseInt([String]); 或 i = Integer.parseIn ...

  8. find命令之exec和xargs

    exec: find是我们很常用的一个Linux命令,但是我们一般查找出来的并不仅仅是看看而已,还会有进一步的操作,这个时候exec的作用就显现出来了. exec解释: -exec  参数后面跟的是c ...

  9. 《Effective Java》读书笔记八(异常)

    No57 只针对异常的情况才使用异常 异常应该只用于异常的情况下,它们永远不应该用于正常的控制流. No58 对可恢复的情况使用受检异常,对编程错误使用运行时异常 Java程序设计语言提供了三种可抛出 ...

  10. Viso Professional 2013版本激活(office 系列产品 -- visio 2013 / project 2013 破解工具 - KMSpico)

    背景: 环境是 win7, 64 bit 装了 visio 2013 , 可以却不能用它来画图,在网上找了一些破解工具,大都不能解决问题.网上不靠谱的广告型文章太多了,比较头痛. 所幸,终于找到正确的 ...