c#可以調用msyql的導入導出命令

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

2.查詢mysql安裝路徑的函數

  private string GetMysqlPath()
        {
            string strPath = string.Empty;
            string strsql = "select @@basedir as basePath from dual ";
            strPath = 數據庫執行當前的strsql

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

3.獲取mysql的安裝bin路徑

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

4.然後根據上一篇中的博客,對mysql進行附加和備份功能。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章