萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> mysql教程 >> 常用mysql數據庫連接字符串

常用mysql數據庫連接字符串

常用mysql教程數據庫教程連接字符串
MyODBC
 
MyODBC 2.50 本地數據庫
 
 

Driver={mySQL};Server=localhost;Option=16834;Database=myDataBase;

 
 
 
MyODBC 2.50 遠程數據庫 
 
 

Driver={mySQL};Server=myServerAddress;Port=3306;Option=131072;Stmt=; Database=myDataBase;Uid=myUsername;Pwd=myPassword;

 
 
 
MyODBC 3.51 本地數據庫
 
 

Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=myDataBase; User=myUsername;Password=myPassword;Option=3;

 
 
 
MyODBC 3.51 遠程數據庫
 
 

Driver={MySQL ODBC 3.51 Driver};Server=data.domain.com;Port=3306;Database=myDataBase;User=myUsername; Password=myPassword;Option=3;

 
 
 
OLE DB, OleDbConnection (.NET)
 
標准
 
 

Provider=MySQLProv;Data Source=mydb;User Id=myUsername;Password=myPassword;

 
 
 
Connector/Net 1.0 (.NET)
 
標准
 
 

Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

 
 
默認端口號是3306. 
 
指定端口號
 
 

Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

 
 
 
命名管道
 
 

Server=myServerAddress;Port=-1;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

 
 
如果端口是-1,意思是告訴驅動程序使用命名管道網絡協議來連接數據庫。
 
MySqlConnection (.NET)
 
eInfoDesigns.dbProvider
 
 

Data Source=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Command Logging=false;

 
 
 
SevenObjects MySqlClient (.NET)
 
標准
 
 

Host=myServerAddress;UserName=myUsername;Password=myPassword;Database=myDataBase;

 
 
 
Core Labs MySQLDirect (.NET)
 
標准
 
 

User ID=root;Password=myPassword;Host=localhost;Port=3306;Database=myDataBase; Direct=true;Protocol=TCP;Compress=false;Pooling=true;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0;

 
 
  
MySQLDriverCS (.NET)
 
標准
 
 

Location=myServerAddress;Data Source=myDataBase;UserID=myUsername;Password=myPassword;Port=3306;Extended Properties="""";
 
 

copyright © 萬盛學電腦網 all rights reserved