String mysqlStr = "Database=test;Data Source=127.0.0.1;User Id=root;Password=root;pooling=false;CharSet=utf8;port=3306";
MySqlConnection mysql = new MySqlConnection(mysqlStr);
或者
string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" +
"SERVER=localhost;" +
"DATABASE=inv;" +
"UID=root;" +
"PASSWORD=root;" +
"OPTION=3";
OdbcConnection MyConnection = newOdbcConnection(MyConString);