Connector/net Connection String Options Reference
Database=dbname;D ATA source=192.168.1.1; port=3306; User id=Root; password=****; charset=UTF8; treattinyasboolean=false;
By the way, all the attributes involved in the source code are listed:
Server,host, data source, DataSource, address, addr, network address: Database location (any of the above keywords are available)
Database,initial Catalog: Database name
Port:socket Port, default 3306
Connectionprotocol,protocol: Connection Agreement, default Sockets
Pipename,pipe: Connection pipeline, default MYSQL
Usecompression,compress: Connection is compressed, default false
Allowbatch: Whether to allow multiple SQL statements to be executed at once, by default true
Logging: Whether log is enabled, default false
Sharedmemoryname: Name of the memory share, default MYSQL
Useoldsyntax,old syntax, oldsyntax: Compatibility with legacy syntax, default false
Connectiontimeout,connection Timeout: Connection timeout wait time, default 15s
Defaultcommandtimeout,command timeout:mysqlcommand timeout time, default 30s
UserID, UID, username, user name, User: Database login account
PASSWORD,PWD: Login Password
Persistsecurityinfo: Whether to keep sensitive information, default false
Encrypt: SSL has been replaced by default, False
Certificatefile: Certificate file (. pfx) format
Certificatepassword: The password for the certificate
Certificatestorelocation: Where to store certificates
Certificatethumbprint: Certificate Thumbprint
Allowzerodatetime: Can date time be zero, default false
Convertzerodatetime: Whether the datetime of zero is converted to Datetime.minvalue, false by default
Useusageadvisor, Usage Advisor: Whether the Assistant is enabled will affect database performance, default false
Procedurecachesize,procedure Cache, Procedurecache: Several stored procedures can be cached at the same time, 0 is forbidden, default 25
Useperformancemonitor,userperfmon, Perfmon: Whether performance monitoring is enabled, false by default
Ignoreprepare: Ignore Prepare () call, default True
Useprocedurebodies,procedure bodies: Check the validity of the stored procedure body and parameters by default True
Autoenlist: Whether active connections are automatically used, default True
Respectbinaryflags: Whether to respond to binary flags on column metadata, by default true
Treattinyasboolean: Whether the TINYINT (1) column is treated as a Boolean, by default True
Allowuservariables: Whether user variables are allowed in SQL, default false
Interactivesession,interactive: Whether the session allows interaction, default false
Functionsreturnstring: Whether all server functions are handled by return string, default False
Useaffectedrows: Whether to return data using the number of rows affected to replace the number of rows found, false by default
Oldguids: whether binary (16) columns are used as Guids, default false
Keepalive: The number of seconds to keep the TCP connection, default 0, does not persist.
Connectionlifetime: The minimum time (in seconds) to remain in the connection pool before the connection is destroyed. Default 0
Pooling: Whether to use thread pool, default True
Minimumpoolsize, min Pool size: The minimum number of threads allowed in the thread pool, default 0
Maximumpoolsize,max Pool Size: The maximum number of threads allowed in a thread pool, default 100
Connectionreset: If the connection expires automatically reset, default False
CharacterSet, CharSet: The character set used to request a connection to the server, default: None
Treatblobsasutf8:binary blobs is treated as UTF8, default false
Blobasutf8includepattern: The matching mode of the column, once the match will be processed by UTF8, default: None
Sslmode: Whether SSL connection mode is enabled, default: Mysqlsslmode.none
private static string connectionstr = "Host=127.0.0.1;uid=root;password=123456;database=fensishenghuo;pooling=false ; charset=utf8mb4; Min Pool size=5; Max Pool size=50; Sslmode=none; ";
MySQL connection string parameter detailed parsing (Daquan reference)