小编har*_*ari的帖子

mysql不被识别为内部或外部命令,可操作程序或批处理

我设置了MySQL路径,但仍然得到相同的错误.请告诉我是否遵循了正确的方法.

MySQL的位置是: C:\Program Files\MySQL\MySQL Server 5.0\bin

在Windows中,系统变量我将路径设置为:

  • 变量名: MYSQL_HOME
  • 变量值: C:\Program Files\MySQL\MySQL Server 5.0\bin

对于PATH设置:

  • 变量名: PATH
  • 变量值: .;%JAVA_HOME%\bin;%MYSQL_HOME%\bin...

如果它不正确,请告诉我正确的路径及其设置.

mysql mysql-error-1064

64
推荐指数
6
解决办法
13万
查看次数

错误C2664:'sprintf':无法将参数1从'std :: string'转换为'char*'

下面是VC++中的插入函数.当我将char更改为字符串数据类型以读取以下代码中的amount变量值时,我收到此错误.

static void Insert(t_analysis* analysis)    
{    
 _bstr_t strunitId;    
 _bstr_t strGdt=time(0);    
_bstr_t strvalue;   
    std::string str;
std::string commandStr = "insert into table1(unitid,g_time_dte_1,h_1,n_1,ch_1,co_1,im_1,ve_1,er_1) Values(123,'" + strGdt +"',";
    char tempBuf[50];
for (int j = 0; j < analysis->ubPeaksIntTab;j++ )
{   
    sprintf(tempBuf, "%d", (analysis->peak + j)->amount);//here it takes the adrress of amount but not the value of amount variable.
    str += commandStr + tempBuf;
    if(j!=analysis->ubPeaksIntTab-1)
       commandStr += ",";
}

commandStr += ")";
_ConnectionPtr pConn = NULL;

try
{       
    HRESULT hr = S_OK;
    CoInitialize(NULL);
    hr = …
Run Code Online (Sandbox Code Playgroud)

visual-c++

1
推荐指数
1
解决办法
3759
查看次数

标签 统计

mysql ×1

mysql-error-1064 ×1

visual-c++ ×1