连接MYSQL数据库的方法有很多种吧? 我看书上说可以用 MYSQL 提供的 API 来连接。 第一行就给来一个 #include "mysql.h" 。 可是我搜遍整个电脑业没有这个头文件。怎么回事,即使有,应该放在哪个路径下呢?
补充说明一下,我要在VC2008里连接谁有带注释的例子也行。我在网上找了很久,几乎都是一个复制另一个,都没个注释,也不知道是个啥意思

解决方案 »

  1.   

    你安装完整的mysql以后,在mysql安装目录的include目录里头就有。
      

  2.   

    http://yuanyu5237.javaeye.com/blog/812514
      

  3.   

    先安装mysql,然后按照上面的做,完了以后就有mysql.h了,可以连接数据库了!
      

  4.   

    你下一个noinstall版的mysql,解开之后就有include目录
      

  5.   

    那是什么版。
    我这提示:
    Enter password: *
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 6
    Server version: 5.1.50-community MySQL Community Server (GPL)Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL v2 licenseType 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      

  6.   

    晕,进到这里:
    http://download.mysql.cn/src/2006/0710/5542.html然后这里:
    http://download.mysql.cn/download.php?artID=5542&goto=L2RkP2dvdG89aHR0cDovL2Rvd25sb2FkLm15c3FsLmNuL2Rvd25sb2FkX2ZpbGUvemlwLzUuMC9teXNxbC1ub2luc3RhbGwtNS4wLjIyLXdpbjMyLnppcA=看看那里的页面就知道了,解压以后就能看到include目录了。