Changing the hybris database to MySQL
Asked Answered
N

2

6

I just finished training on hybris as core developer. I've done all the trails and have a project coming soon, but now I would like to tweak the system a little bit to know more about it. My is that I would like to change the database to MySQL but when I do change the settings on hybris platform on these files project.properties and local.properties.

But the problem is that it gives me an exception when I try to run the hybris server again, which is something like this:

console output

Novosibirsk answered 28/11, 2014 at 12:42 Comment(0)
T
9

If you want to connect to MySQLyou just have to change configuration in hybris/config/local.properties.

db.url=jdbc:mysql://localhost/hybris
db.driver=com.mysql.jdbc.Driver
db.username=anything but not "root"
db.password=
mysql.allow.fractional.seconds=true (if you're using MySQL 5.6.4 or later)

Since hybris Commerce Suite version 5.0.2, MySQL connector is not shipped with the hybris Commerce Suite . Please download the file and put it in the folder ${HYBRIS_BIN_DIR}/platform/lib/dbdriver


v6 Update

Now mysql.allow.fractional.seconds=true is already present in project.properties of platform.

Also to avoid locks you can use add in mysql configs :

transaction_isolation=READ-COMMITTED
innodb_autoinc_lock_mode = 2
innodb_locks_unsafe_for_binlog=1 

Transcript answered 1/12, 2014 at 9:7 Comment(9)
Looks like Aph1ka did manage to connect with MySQL though. But some part of her hybris application is trying to insert a value that's too long for a key.Solothurn
Thats true Henrique, I've already applied what Alain is suggesting... but the problem is the exception thrown by the server and the key that its complaining about is automatically generated by hybris :(Novosibirsk
@Novosibirsk So you have a previous installation with HSQLDB, you switched the DB to Mysql and now you can't start hybris that's right? Have you tried to run ant clean all then ant initialize before starting hybris?Transcript
@alain yes I did that, i've done ant clean as well, nothing changes and now i'm thinking of increasing the innoDB max bytes and utf encodings on the database as suggested on other sources... and thaks bro for being with me on this one.Novosibirsk
@Novosibirsk You're welcome, so did increasing innoDB max bytes helped you?Transcript
yes it did, but now i'm facing yet another error, but i think i'll be able to figure it out. thanks again alain...Novosibirsk
What's the significance of the mysql.allow.fractional.seconds option?Persas
@Mikaveli According to the doc : This flag allows to create datetime columns which support fractional seconds. For more information, see https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-4.html With MySQL 5.6.4 (or later) the mysql.allow.fractional.seconds property must be defined. Otherwise java.util.Date columns may behave in the strange way of date values getting rounded up ( means into the future ) instead of being truncated.Transcript
how to configure the settings for hybris to use multiple MYSQL Databases??Trestle
C
2

Don't forget to build the server using "ant all". Without building the server, the configuration is not applied.

Campground answered 17/10, 2017 at 13:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.