Changing the hybris database to MySQL

Aph1ka picture Aph1ka · Nov 28, 2014 · Viewed 12k times · Source

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

Answer

alain.janinm picture alain.janinm · Dec 1, 2014

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