Connection strings for MySQL

ODBC
  • 复制到剪贴板本地服务器
    Driver={mySQL};Server=mySrvName;Option=16834;Database=mydatabase;
  • 复制到剪贴板远程服务器
    Driver={mySQL};Server=data.domain.com;Port=3306;Option=131072; Stmt=;Database=mydatabase; Uid=username;Pwd=password;
OLE DB, OleDbConnection (.NET)
  • 复制到剪贴板标准连接
    Provider=MySQLProv;Data Source=mydb;User Id=UserName; Password=asdasd;
MySqlConnection (.NET)
  • 复制到剪贴板eInfoDesigns.dbProvider
    Data Source=server;Database=mydb;User ID=username; Password=pwd;Command Logging=false
    说明:此写法仅用于通过eInfoDesigns dbProvider连接:
    C#:
    using eInfoDesigns.dbProvider.MySqlClient;
    MySqlConnection oMySqlConn = new MySqlConnection();
    oMySqlConn.ConnectionString = "my connectionstring";
    oMySqlConn.Open();
    VB.NET:
    Imports eInfoDesigns.dbProvider.MySqlClient
    Dim oMySqlConn As MySqlConnection = New MySqlConnection()
    oMySqlConn.ConnectionString = "my connectionstring"
    oMySqlConn.Open()

©2009 vhalpha#163.com 鲁ICP备09080449号