重庆熊猫 Loading

C#/VB 数据库连接字符串大全

C#/VB 数据库连接字符串大全

https://www.connectionstrings.com/

SQL Server常用

Standard Security

Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;

Trusted Connection

Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;

Connection to a SQL Server instance
The server/instance name syntax used in the server option is the same for all SQL Server connection strings.

Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;Password=myPassword;

Using a non-standard port
If your SQL Server listens on a non-default port you can specify that using the servername,xxxx syntax (note the comma, it's not a colon).

Server=myServerName,myPortNumber;Database=myDataBase;User Id=myUsername;Password=myPassword;

Connect via an IP address

Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

Connection to a SQL Server instance

Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;Password=myPassword;

完整所有SQL Server连接字符串
https://www.connectionstrings.com/sql-server/

MySQL常用

Standard

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

Specifying TCP port

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

The port 3306 is the default MySql port.
The value is ignored if Unix socket is used.

Multiple servers
Use this to connect to a server in a replicated server configuration without concern on which server to use.

Server=serverAddress1, serverAddress2, serverAddress3;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

完整所有MySQL连接字符串
https://www.connectionstrings.com/mysql/

posted @ 2022-05-27 09:28  重庆熊猫  阅读(125)  评论(0编辑  收藏  举报