MySQL connection string Parameter Parsing (explanation)

Source: Internet
Author: User
Tags certificate fingerprint mysql connection string ssl connection

I was forced to switch to the MySQL database and found that when reading the database, all tinyint type values were converted to boolean, so that values greater than 1 were lost and changed to true. MySQL does not have the boolean type, and all data is stored as tinyint. This is fine, but it should not be changed to boolean during read-back. There is no solution for network retrieval. I am going to report a bug to the official team. I think the official team should not have such a low-level error. First download the connector/net source code and study it. I found that the treattinyasboolean attribute exists, there is no search result for Baidu. Google has several English entries. It seems that everyone has not noticed this, or is rarely used. net Play
MySQL.

In this way, the database connection string is changed to this form, and everything is normal:
Database =Dbname; Data 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 can be used)
Database, initial catalog: Database Name
Port: Socket port. The default value is 3306.
Connectionprotocol, Protocol: connection protocol, sockets by default
Pipename, pipe: connection pipe, default MySQL
Usecompression, compress: whether the connection is compressed. The default value is false.
Allowbatch: whether to allow multiple SQL statements to be executed at a time. The default value is true.
Logging: whether to enable logging. The default value is false.
Sharedmemoryname: name of the memory share. The default value is MySQL.
Useoldsyntax, old syntax, and oldsyntax: compatible with the old syntax. The default value is false.
Connectiontimeout and connection Timeout: the connection timeout wait time. The default value is 15 s.
Defaultcommandtimeout, command Timeout: mysqlcommand timeout time, 30 s by default
Userid, uid, username, user name, user: Database Logon account
Password, PWD: logon Password
Persistsecurityinfo: whether to retain sensitive information. The default value is false.
Encrypt: it has been replaced by SSL. The default value is false.
Certificatefile: Certificate file (. pfx) Format
Certificatepassword: Certificate Password
Certificatestorelocation: The storage location of the certificate
Certificatethumbprint: Certificate fingerprint
Allowzerodatetime: whether the datetime value can be zero. The default value is false.
Convertzerodatetime: whether the zero datetime is converted to datetime. minvalue. The default value is false.
Useusageadvisor and usage Advisor: whether to enable assistant affects database performance. The default value is false.
Procedurecachesize, procedure cache, and procedurecache: several stored procedures can be cached at the same time. 0 indicates disabled. The default value is 25.
Useperformancemonitor, userperfmon, perfmon: whether to enable performance monitoring. The default value is false.
Ignoreprepare: whether to ignore the prepare () call. The default value is true.
Useprocedurebodies, Procedure Bodies: whether to check the validity of the stored procedure body and parameters. The default value is true.
Autoenlist: whether to automatically use the active connection. The default value is true.
Respectbinaryflags: whether to return the binary flag of the metadata in the column. The default value is true.
Treattinyasboolean: whether to treat the tinyint (1) column as boolean. The default value is true.
Allowuservariables: whether to allow SQL to show user variables. The default value is false.
Interactivesession and interactive: whether the session allows interaction. The default value is false.
Functionsreturnstring: whether all server functions are processed according to the returned string. The default value is false.
Useaffectedrows: whether to use the affected number of rows instead of the queried number of rows to return data. The default value is false.
Oldguids: whether to use the binary (16) column as the guids. The default value is false.
Keepalive: specifies the number of seconds for TCP connections. The default value is 0.
Connectionlifetime: minimum time (in seconds) that the connection pool maintains before the connection is destroyed ). Default Value: 0
Pooling: Indicates whether to use the thread pool. The default value is true.
Minimumpoolsize, Min pool size: the minimum number of threads allowed in the thread pool. The default value is 0.
Maximumpoolsize, Max pool size: Maximum number of threads allowed in the thread pool, 100 by default
Connectionreset: whether to automatically reset after the connection expires. The default value is false.
Characterset, charset: the character set used for connecting requests to the server. Default Value: None
Treatblobsasutf8: whether binary blobs are treated as utf8. The default value is false.
Blobasutf8includepattern: the matching mode of the column. Once matched, it will be processed by utf8. Default Value: None
Sslmode: whether to enable the SSL connection mode. Default Value: mysqlsslmode. None

Article Source: http://home.3233567.cn/space.php? Uid = 182 & Do = Blog & id = 159

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.