1

当我尝试在使用 MySQL 的 cloudfoundry 上运行我的页面时,我收到了这个错误

    org.springframework.jdbc.CannotGetJdbcConnectionException: 
Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: 
Cannot create PoolableConnectionFactory (Unknown initial character set index '192' received from server. 
Initial client character set can be forced via the 'characterEncoding' property.)

我错过了什么 ?我确实尝试在下面将我的 UTF-8 更改为 LATIN,但仍然收到错误

ALTER TABLE t MODIFY col1 VARCHAR(50) CHARACTER SET latin1;

感谢所有的答复

我明白

+----------------------+-----------------+
| Variable_name        | Value           |
+----------------------+-----------------+
| collation_connection | utf8_unicode_ci |
| collation_database   | utf8_unicode_ci |
| collation_server     | utf8_unicode_ci |
+----------------------+-----------------+

来自 cloudfoundry 数据库

4

2 回答 2

3

我正在使用mysql-connector-java-3.1.7-bin.jar,并且在更改为mysql-connector-java-5.1.21-bin.jar之后效果很好。时间

于 2012-07-19T02:13:42.597 回答
2

在 /etc/mysql 中检查您的配置,如下所示。评论他们,然后再试一次。您必须重新启动 mysql 服务(/bin/vcap restart)。

collat​​ion_server = utf8_unicode_ci

character_set_server = utf8

于 2012-07-18T11:51:45.573 回答