欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C#中實(shí)現(xiàn)查找mysql的安裝路徑

 更新時(shí)間:2015年06月26日 09:47:35   投稿:junjie  
這篇文章主要介紹了C#中實(shí)現(xiàn)查找mysql的安裝路徑,本文講解使用SQL語句查詢出mysql的安裝路徑,方便在備份時(shí)使用,需要的朋友可以參考下

1.c#可以調(diào)用msyql的導(dǎo)入導(dǎo)出命令,但是需要先判斷客戶機(jī)是否安裝了mysql,及其安裝mysql的路徑問題。

2.查詢mysql安裝路徑的函數(shù)

復(fù)制代碼 代碼如下:

  private string GetMysqlPath()
        {
            string strPath = string.Empty;
            string strsql = "select @@basedir as basePath from dual ";
            strPath = 數(shù)據(jù)庫執(zhí)行當(dāng)前的strsql

            strPath = strPath.Replace("/", "\\");
            return strPath;
        }


3.獲取mysql的安裝bin路徑
復(fù)制代碼 代碼如下:

strmysqlPath= GetMysqlPath() + "\\bin";

4.然后根據(jù)上一篇中的博客,對(duì)mysql進(jìn)行附加和備份功能。

相關(guān)文章

最新評(píng)論