Bug #70041 Cannot use Chinese character in the connection string for the database
Submitted: 14 Aug 2013 21:58 Modified: 18 Feb 2015 4:21
Reporter: Gabriela Martinez Sanchez Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.7.4 OS:Any
Assigned to: Fernando Gonzalez.Sanchez CPU Architecture:Any

[14 Aug 2013 21:58] Gabriela Martinez Sanchez
Description:
When using a connection string that includes Chinese characters on the database property an error is thrown:

MySqlException: Unknown database '???' 

How to repeat:
1- Run the following code: 

MySqlConnection conn = new MySqlConnection(@"server=localhost;database=数据库;uid=root;pwd=password;charset=utf8;"); 
conn.Open(); 

As a workaround the database can be specified after using a mysqlcommand with
 "USE 数据库;"
which works fine. 

Suggested fix:
Add the charset=utf8 starting on the handshake with the server.
[14 Aug 2013 22:00] Gabriela Martinez Sanchez
Verified with Connector 6.7.4 using the specified code. Also if using Chinese characters in the UserID it doesn't work either.
[18 Feb 2015 4:21] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Connector/Net 6.7.7 release, and here's the changelog entry:

A connection string that included Chinese characters for a database or uid
property would emit the following exception; "MySqlException: Unknown
database '???'".

Additional MySQL Connector/Net versions are being tested.

Thank you for the bug report.