You must also set ConnectionProtocol=pipe to used named pipes. The name of the Windows named pipe to use to connect to the server. Requires Pooling=True.Ĭonnection Protocol, ConnectionProtocol, Protocol LeastConnections Servers are tried in ascending order of number of currently-open connections in this connection pool. Random Servers are tried in a random order. FailOver Each new connection tries to connect to the first host subsequent hosts are used only if connecting to the first one fails. The options include: RoundRobin Each new connection opened for this connection pool uses the next host name (sequentially with wraparound). The load-balancing strategy to use when Host contains multiple, comma-delimited, host names. This may be required if the MySQL user account only has access rights to particular databases on the server. (Optional) The case-sensitive name of the initial database to use. This retains the benefits of connection pooling. User ID, UserID, Username, Uid, User name, Userįor systems that use frequently-updated authentication tokens (such as Amazon Aurora RDS with IAM Authentication), leave this value empty, and set MySqlConnection.ProvidePasswordCallback to a delegate that will provide the password (or authentication token) on demand before calling MySqlConnection.Open. The TCP port on which MySQL Server is listening for connections. Only a single socket name can be specified. On Unix-like systems, this can be a fully qualified path to a MySQL socket file, which will cause a Unix socket to be used instead of a TCP/IP socket. Multiple hosts can be specified in a comma-delimited list. The host name or network address of the MySQL Server to which to connect. Server, Host, Data Source, DataSource, Address, Addr, Network Address These options specify how to connect and authenticate to a MySQL database. There are also several unique options that are supported only by MySqlConnector, a replacement for MySql.Data that fixes bugs,Īdds new features, and improves database access performance. New MySqlConnection("Server=YOURSERVER User ID=YOURUSERID Password=YOURPASSWORD")įor all the other options, see the tables below. The simplest MySQL connection string for C# is:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |