. NET connection MySQL database statements

Source: Internet
Author: User

In my project, the Connect database statement is written in the configuration file:

<add key= "ConnectionString" value= "database= ' testdata ';D ata source= ' localhost '; port= ' 3306 '; User id= ' root '; password= ' root '; charset= ' UTF8 '; Treattinyasboolean=false "/>



where database is the name, data source is the server address where the database resides, "localhost" represents the local address, and port is the port number of the MySQL database the user ID represents the username password on behalf of the user password. The CharSet table requests the character set used by the server to connect, by default: None because Chinese is present in the database in the project, the different character sets of MySQL are not identical to the recognition in both Chinese and English. The use of UTF8 can ensure that there is no Chinese garbled phenomenon.



At the same time the database base character set is "UTF8", the database collation is "UTF8_GENERAL_CI";


. NET connection MySQL database statements

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.