我使用的是visual studio 2012 c#去链接带有可视化界面mysql workbench 的mysql 15
1个回答
展开全部
方法1;
public DBMySQL(string database,string source,string id,string pwd,bool pooling,string charset,string port)
{
mylogin = @"Database=" + database + ";Data Source=" + source + ";User Id=" + id + ";Password=" + pwd + ";pooling=" + pooling +";CharSet=" + charset + ";port=" + port + "";
}
方法2:
public DBMySQL(string database, string source, string id, string pwd,bool pooling, string charset)
{
mylogin = @"Database=" + database + ";Data Source=" + source + ";User Id=" + id + ";Password=" + pwd + ";pooling=" + pooling +";CharSet=" + charset + ";port=3306";
}
方法3:
public DBMySQL(string database, string source, string id, string pwd, bool pooling)
{
mylogin = @"Database=" + database + ";Data Source=" + source + ";User Id=" + id + ";Password=" + pwd + ";pooling=" + pooling + ";CharSet=utf8;port=3306";
}
方法4:
public DBMySQL(string database, string source, string id, string pwd)
{
mylogin = @"Database=" + database + ";Data Source=" + source + ";User Id=" + id + ";Password=" + pwd + ";pooling=false;CharSet=utf8;port=3306";
}
完整的连接
//public string mylogin = @"Database=xtserver;Data Source=localhost;User Id=root;Password=me24851;pooling=false;CharSet=utf8;port=3306";
public DBMySQL(string database,string source,string id,string pwd,bool pooling,string charset,string port)
{
mylogin = @"Database=" + database + ";Data Source=" + source + ";User Id=" + id + ";Password=" + pwd + ";pooling=" + pooling +";CharSet=" + charset + ";port=" + port + "";
}
方法2:
public DBMySQL(string database, string source, string id, string pwd,bool pooling, string charset)
{
mylogin = @"Database=" + database + ";Data Source=" + source + ";User Id=" + id + ";Password=" + pwd + ";pooling=" + pooling +";CharSet=" + charset + ";port=3306";
}
方法3:
public DBMySQL(string database, string source, string id, string pwd, bool pooling)
{
mylogin = @"Database=" + database + ";Data Source=" + source + ";User Id=" + id + ";Password=" + pwd + ";pooling=" + pooling + ";CharSet=utf8;port=3306";
}
方法4:
public DBMySQL(string database, string source, string id, string pwd)
{
mylogin = @"Database=" + database + ";Data Source=" + source + ";User Id=" + id + ";Password=" + pwd + ";pooling=false;CharSet=utf8;port=3306";
}
完整的连接
//public string mylogin = @"Database=xtserver;Data Source=localhost;User Id=root;Password=me24851;pooling=false;CharSet=utf8;port=3306";
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询