亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1639 | 回復(fù): 1
打印 上一主題 下一主題

命令行可以連接,用C程序卻報錯 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2006-05-12 17:45 |只看該作者 |倒序瀏覽
我的Mysql服務(wù)器是一臺win2K,版本是4.1,客戶端是linux,在命令行下連接沒問題的,在程序中連接就提示錯誤:Client does not support authentication protocol requested by server; consider upgrading MySQL client。
命令行下:
mysql -h 192.168.0.88 -u testdb -pwst01 -P9898
可以連接到數(shù)據(jù)庫查詢、刪除都沒問題。用程序連接卻報上面的錯誤,請指點一下。不勝感激。

MYSQL *ConnectDB(int iTimeOut, char *mHost, char *mUser, char *mPwd, char *myDB,  int mPort)
{
 int bCompress, bInFile, iSelectLimit, bSSL;
 char init_command[100];
 MYSQL *mySQL=NULL, *mySQLConnect=NULL;

   bCompress = 1;
   bInFile = 0;
   iSelectLimit = 1000;
   bSSL = 0;
   mysql_opt_max_join_size = 1000000L;
   mysql_client_flags = 0;

   mySQL = mysql_init(0);

   if (bCompress)
  {
        mysql_options(mySQL, MYSQL_OPT_COMPRESS,0);
        mysql_client_flags |= CLIENT_COMPRESS;
  }
          
  if (iTimeOut)
      mysql_options(mySQL, MYSQL_OPT_CONNECT_TIMEOUT, (char*)&iTimeOut);

  if(bInFile)
      mysql_options(mySQL, MYSQL_OPT_LOCAL_INFILE, bInFile ? 0 : (char*) &bInFile);

   if (iSelectLimit > 0)
   {
       if (mysql_opt_max_join_size > 0)
        sprintf(init_command, "SET SQL_SELECT_LIMIT=%d,SQL_MAX_JOIN_SIZE=%d", iSelectLimit, mysql_opt_max_join_size);
      else
        sprintf(init_command, "SET SQL_SELECT_LIMIT=%d", iSelectLimit);
  }
   else
   {
      if (mysql_opt_max_join_size > 0)
         sprintf(init_command, "SET SQL_MAX_JOIN_SIZE=%d", mysql_opt_max_join_size);
      else
         sprintf(init_command, "SET SQL_BIG_SELECTS=1");
   }

        mysql_options(mySQL, MYSQL_INIT_COMMAND, init_command);

   if (bSSL)
        mysql_client_flags |= CLIENT_SSL;

   if( !(mySQLConnect = mysql_real_connect(mySQL, myHost, myUser, myPwd, myDB, myPort, NULL, mysql_client_flags)) )
   {
        sprintf(errstring, "mysql_real_connect failed: %s", mysql_error(mySQL));
        if (mySQL != 0)
           mysql_close(mySQL);
        mySQL = NULL;
        return NULL;
   }
  
        return mySQL;
}

論壇徽章:
0
2 [報告]
發(fā)表于 2006-05-12 18:07 |只看該作者
原帖由 xurb17 于 2006-5-12 17:45 發(fā)表
我的Mysql服務(wù)器是一臺win2K,版本是4.1,客戶端是linux,在命令行下連接沒問題的,在程序中連接就提示錯誤:Client does not support authentication protocol requested by server; consider upgrading MySQL clie ...


根據(jù)提示的,你用c鏈接的libmysqlclient版本可能太老了,更新一下mysql鏈接庫應(yīng)該就可以了
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP