MySQL connection string parameter resolution (explanation)

Source: Internet
Author: User
Tags datetime mysql connection string ssl connection

Forced to go to the MySQL database and found that when reading the database, the value of the tinyint type is converted to a Boolean, so that values greater than 1 are lost and become true. Check data MySQL does not have a Boolean type, are stored as tinyint, this is no harm, but read back should not all become a Boolean ah. Network retrieval no solution, ready to report to the official bug, fine think the official should not have such a low-level error, first download connector/net source research, found that there is treattinyasboolean this attribute, search Baidu no results, Google has a few English, It seems that everyone has not noticed this, or that it is seldom used. NET to play MySQL.

This turns the database connection string into this form and everything is fine:
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

Article Source: http://home.3233567.cn/space.php?uid=182&do=blog&id=159

MySQL connection string parameter resolution (explanation)

Related Article

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.