MySQL 5 can run in strict mode, which causes errors to be thrown instead of warnings when data truncation occurs (see mysql bug 14048
).
Errors may look similar to this:
11:16:36,520 ERROR JDBCExceptionReporter ? Data truncation: Data too long for column 'jbp_viewrealemail' at row 1
While MySQL 5 is not yet supported, there is a way to prevent the error from being thrown during the installation of the portal:
- If you have MySQL 5 installed already and running in strict mode, edit the my.ini (or my.cfg) file of MySQL and remove the "STRICT_TRANS_TABLES" part from the line: sql-mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
- Add "jdbcCompliantTruncation=false" in your datasource descriptor file (*-ds.xml) under the deploy directory. Your connection URL should look like: <connection-url>jdbc:mysql://your-host-name:3306/jbossportal?useServerPrepStmts=false&jdbcCompliantTruncation=false</connection-url>
This should prevent any further data truncation related errors during the portal installation.
本文介绍如何在MySQL 5.x中避免安装门户时出现的数据截断错误。通过调整MySQL配置文件my.ini或my.cfg,并在数据源描述符文件中添加特定参数,可以有效防止此类错误的发生。
1662

被折叠的 条评论
为什么被折叠?



