zoukankan      html  css  js  c++  java
  • mysql环境配置

     #include "db_mysql.h"

    class CProperty

    {

    public:

    CMysql m_Mysql;

    }

    void CProperty::Init()
    {
     net::AddressStr strAddr = Pogo::NarrowToWide(g_pGateConfig->szListenAddr);
     int nMaxcon = g_pGateConfig->nMaxCon;
     bool bFlag = m_Server.Init(strAddr,nMaxcon);//
     if(!bFlag)
     {
      return ;
     }

     /*if(!m_wdList.Start(addr,nMaxcon))
     {
      return;
     }*/
     if(m_Mysql.Init(g_pGateConfig->szDBServerAddr,
                g_pGateConfig->szDBUser,
                g_pGateConfig->szDBPassWord,
                g_pGateConfig->szDBName))
     {
      m_Mysql.querys("set names utf8");
     }
     else
      return  ;
     Logger::Instance()->Init();
     m_bValid = true;
     return;

      //LogDB
    /* if (m_MysqlLog.Init(g_pGateConfig->szLogDBServerAddr,
                             g_pGateConfig->szLogDBUser,
                             g_pGateConfig->szLogDBPassWord,
                             g_pGateConfig->szLogDBName))
       {
        m_MysqlLog.querys("set names utf8");
       }
       else
        return  ;
     Logger::Instance()->Msg("Log Thread Start");
     pthread_create((pthread_t*) & m_nUpdateDBThreadHandle, NULL, &UpdateDBThread, this);
     //pthread_create((pthread_t*) & m_nLogDBThreadHandle, NULL, &LogDBThread, this);


     return ;*/
    }

    void CProperty::Shutdown()
    {
    // m_wdList.Shutdown();
    // void *ec;
    // pthread_join(m_nUpdateDBThreadHandle, &ec);
    // void* el;
    // pthread_join(m_nLogDBThreadHandle, &el);
     m_Mysql.disconnect();
     //m_MysqlLog.disconnect();
    }

  • 相关阅读:
    机器学习相关——协同过滤
    推荐系统绝对不会向你推荐什么
    “猜你喜欢”是怎么猜中你心思的?
    Python-Matplotlib安装及简单使用
    经典的机器学习方面源代码库
    Python正则表达式指南
    Python yield 使用浅析
    c++编程规范的纲要和记录
    深度理解依赖注入(Dependence Injection)
    依赖注入
  • 原文地址:https://www.cnblogs.com/byfei/p/3112303.html
Copyright © 2011-2022 走看看