Finding the installation path of mysql implemented in C

  • 2021-06-28 13:40:47
  • OfStack

1.c#can invoke msyql's import and export commands, but you need to first determine if the client has mysql installed and the path to install mysql.

2. Functions to query the mysql installation path


  private string GetMysqlPath()
        {
            string strPath = string.Empty;
            string strsql = "select @@basedir as basePath from dual ";
            strPath = Database Execution Current strsql             strPath = strPath.Replace("/", "\\");
            return strPath;
        }

3. Get the installation bin path for mysql

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

4. Then attach and backup mysql according to the blog in the last article.


Related articles: