Mysql
下载mysql连接驱动mysql-connector-java.jar,放在${HYBRIS_BIN_DIR}/platform/lib/dbdriver文件下。
对${HYBRIS_CONFIG_DIR}/local.properties文件进行配置
属性名
属性描述
db.url
指定访问数据库的路径,例如
jdbc:mysql://localhost/hybris?useConfigs=maxPerformance&characterEncoding=utf8
注意:useConfigs=maxPerformance该参数表示连接驱动中的
com/mysql/jdbc/configs/maxPerformance.properties文件内所有属性定义
db.driver
用于访问数据库的JDBC驱动程序类的完全限定名。
com.mysql.jdbc.Driver
db.username
用于访问数据库的用户帐户的名称。
最好不要使用root这种特殊权限的账户。
db.password
访问数据库账户的密码。
db.tableprefix
给表明加前缀。
mysql.optional.tabledefs
指定MySQL数据库运行时参数
mysql.tabletype
指定使用MySQL数据库表的类型
mysql.allow.fractional.seconds
该属性在hybris5.2.0引入,
如果你使用的是MySQL 5.6.4或更高将该属性设置为true。该标志允许创建DateTime列支持小数秒。
如果使用的MySQL低于5.6.4,必需设置改参数为false,或者直接注释掉
db.customsessionsql
该属性在hybris5.2.0引入,由于MySQL事务处理的最新变化,隔离级别的Repeatable Read 可能导致频繁的死锁。由于Hybris5.2.0将隔离级别更改为 Read Committed,
该你可以设置属性db.customsessionsql=SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
模板
# connection
db.url=jdbc:mysql://:/?useConfigs=maxPerformance&characterEncoding=utf8
db.driver=com.mysql.jdbc.Driver
db.username=
db.password=
# table prefix e.g. if db is shared
db.tableprefix=
# other *mandatory* settings
db.customsessionsql=SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
mysql.optional.tabledefs=CHARSET=utf8 COLLATE=utf8_bin
mysql.tabletype=InnoDB
# MySQL DATETIME handling
# from MySQL 5.6.4 -> mysql.allow.fractional.seconds=true
# before MySQL 5.6.4 -> mysql.allow.fractional.seconds=false (or omit the property)
#
mysql.allow.fractional.seconds=true
#
# Note: after changing this property you must re-run initialization / update because
# is only has a effect if the initialization / update DDL statements are re-generated!
#