MySQl Connection String

Pablo Mereles
14 de Septiembre del 2005
Aca les mando los strings para conecciones con MySql que vi que algunos tenian problemas.
salu2
# MySQL

* ODBC


o ODBC 2.50 Local database:
"Driver={mySQL};Server=localhost;Option=16834;Database=mydatabase;"


o ODBC 2.50 Remote database:
"Driver={mySQL};Server=data.domain.com;Port=3306;Option=131072;Stmt=;Database=my-database;Uid=username;Pwd=password;"


o ODBC 3.51 Local database:
"DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=myDatabase;USER=myUsername;PASSWORD=myPassword;OPTION=3;"


o ODBC 3.51 Remote database:
"DRIVER={MySQL ODBC 3.51 Driver};SERVER=data.domain.com;PORT=3306;DATABASE=myDatabase; USER=myUsername;PASSWORD=myPassword;OPTION=3;"


* OLE DB, OleDbConnection (.NET)


o Standard:
"Provider=MySQLProv;Data Source=mydb;User Id=UserName;Password=asdasd;"
* MySqlConnection (.NET)


o eInfoDesigns.dbProvider:
"Data Source=server;Database=mydb;User ID=username;Password=pwd;Command Logging=false"

This one is used with eInfoDesigns dbProvider, an add-on to .NET

o Declare the MySqlConnection:

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()


* SevenObjects MySqlClient (.NET)


o Standard:
"Host=server; UserName=myusername; Password=mypassword;Database=mydb;"

This is a freeware ADO.Net data provider from SevenObjects

* Core Labs MySQLDirect (.NET)


o Standard:
"User ID=root; Password=pwd; Host=localhost; Port=3306; Database=test;Direct=true; Protocol=TCP; Compress=false; Pooling=true; Min Pool Size=0;Max Pool Size=100; Connection Lifetime=0"