zoukankan      html  css  js  c++  java
  • MySql C++调用库Connector/c++编译 和 接口封装【一】mysql数据库安装

    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    = 123456
    port        = 3306
    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        = 3306
    socket    = /tmp/mysql.sock
      2. 控制台(cmd)输入:
    mysqld --install MySQL --defaults-file="C:Program FilesMySQLMySQL Server 5.6my.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:mysqlinmysqld --install". I added the in 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:mysqlin'. I was working under the assumption that the mysqlin 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:mysqlinmysqld --install MySQL --defaults-file=C:mysqlmy.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 filesmysqlmysql server 5.1inmysqld.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~2easyph~1.0mysqlinmysqld --install

    to get to mysqld in

    D:Program Files (x86)EasyPHP-5.3.6.0mysqlin

    You can get the short names with the directory command:

    DIR /X

     
     
  • 相关阅读:
    第一次会议(2019.3.4)
    改革春风吹满地小组~~成立了~~⭐😄~~
    PYQT5 系列(一)——参考自《弗兰克万岁》
    Springboot2.0学习笔记1__微服务及springboot的作用
    Java学习之---------------反射
    Jquery对select的操作 添加一个select
    匿名函数
    数据库迁移
    EF 未应用自动迁移,因为自动迁移会导致数据丢失的解决办法
    在Chrome+Visual Studio中调试asp.net程序很慢的问题(Firefox也有类似问题)
  • 原文地址:https://www.cnblogs.com/sixbeauty/p/4749827.html
Copyright © 2011-2022 走看看