Search code examples
mysqlhibernateutf-8utf8mb4

Update mysql from v5.1 to v5.6, can not connect mysql


I would like to update mysql from v5.1 to v5.6, so that we can use utfmb4 instead of utf8. After I updated my mysql, I changed the hibernate conf file connection url to
jdbc:mysql://xxx.xxx.xxx.xxx:3306/app?characterEncoding=utf8mb4, i.e. utf8 to utf8mb4 and
then I failed to connect db. If I changed it back to utf8, it worked.

The error info: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source

pls help me.


Solution

  • Hope this will help: http://info.michael-simons.eu/2013/01/21/java-mysql-and-multi-byte-utf-8-support/

    Best regards,