MYSQL Link String

Source: Internet
Author: User
Tags connection pooling mysql connection string connectionstrings

MySQL Connection string Summary

1. Local Database connection
<connectionStrings>
<add name= "ConnectionString" connectionstring= "Server=localhost;option=16834;database=mydatabase" ProviderName = "MySql.Data.MySqlClient"/>
</connectionStrings>

2. Remote Data connection
server=myserveraddress;option=131072; stmt=;D atabase=mydatabase; User=myusername; Password=mypassword;>

3. Special TCP/IP port connection
server=myserveraddress; port=3306;option=131072; stmt=;D atabase=mydatabase; User=myusername; Password=mypassword;

4. Standard connection
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=;

Description: The default port for this driver is 3306. If not specifically indicated in the connection string is the 3306 port connected to MySQL.

The meaning of each character in the MYSQL link:

Parameter name Parameter description Default value Minimum version requirements
User Database user name (used to connect to database) All versions
Password User password (used to connect to database) All versions
Useunicode If the Unicode character set is used, the value of this parameter must be set to True if the parameter characterencoding is set to gb2312 or GBK False 1.1g
Characterencoding When Useunicode is set to True, the character encoding is specified. For example, can be set to gb2312 or GBK False 1.1g
AutoReConnect Is the connection automatically reconnected when the database connection is interrupted abnormally? False 1.1
Autoreconnectforpools Whether to use a reconnection policy for database connection pooling False 3.1.3
Failoverreadonly Is the connection set to read-only after the automatic reconnection is successful? True 3.0.12
Maxreconnects When AutoReConnect is set to true, the number of times to retry the connection 3 1.1
Initialtimeout When AutoReConnect is set to true, the time interval between two re-interconnects, in seconds 2 1.1
ConnectTimeout Time-out, in milliseconds, when establishing a socket connection with the database server. 0 means never timeout, for JDK 1.4 and later 0 3.0.1
Sockettimeout Socket operation (Read-write) timeout, in milliseconds. 0 means never time out 0 3.0.1

MYSQL Link String

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.