Knowledgebase: ColdFusion

Issue with ColdFusion 10 Unicode Characters and MySQL DSN

Posted by on March 01 2013 04:21 PM

Issues have been reported with ColdFusion 10 and using the default MySql driver and Unicode characters.

According to the ColdFusion 10 documentation, enabling Unicode characters consists of adding "useUnicode=yes&characterEncoding=UTF-8" to the "Connection String" option under Advanced Settings for the MySql DSN.  However, this appears to return the following error on some servers:

Connection verification failed for data source: XXXXXX
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
The root cause was that: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

Adding the "Connection String" as ";useUnicode=yes;characterEncoding=UTF-8" allows the DSN to be created and connects successfully.  However, inserting Unicode characters to the database still fails.

The final resolution is to create an "other" JDBC DSN

  • JDBC URL: jdbc:mysql://{IP ADDRESS}:3306/{schema}?tinyInt1isBit=false&useUnicode=yes&characterEncoding=UTF-8
  • Driver Class: com.mysql.jdbc.Driver

NOTE: The HostMySite control Panel does not support creation of JDBC datasource connections. Please contact us and reference this article to have the JDBC DSN created manually.

(4 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Copyright © 2016 HostMySite