Skip to Content

SAP Hybris Commerce gives great flexibility, allowing you to choose a database best suited to your solution. Below are few recomanded DB’s.

  1. HSQL DB – Default out-of-the-box solution
  2. MySQL
  3. Oracle
  4. Microsoft SQL Server
  5. HANA

In this blog we will see how to install MySQLDB.

SAP Hybris by default comes with HSQLDB and its configuration can be find in project.properties file in Platform directory.

If you search with MySQL in the same file, you will find details to be configured for MySQL database connection.

As you can see MySQL configuration commeted out.
In order use MySQL DB do we need to make the changes in project.property file of platform directory?
The answer is NO, We should not touch any of the extensions provided by Hybris. The reason is during upgrade all your custom data will get overwrite with standard Hybris data.

So then where do we need to make changes?
Hybris has provided one more file local.properties in Config directory. All your custom config changed should be done here and its unaffected during upgrades.

Since we are going to use the same keys with different values, the highest precedence always goes to local.properties file first and hence MySQL DB will be connected rather than HSQL DB.

If we don’t define any DB related configuration inside local.porperties file then HSQL DB configuration inside platform’s project.properties file will be considered and HSQL DB will be connected.

So lets start..

First we need to install the MySQL. Follow the below link. Video demonstrated with older version, but when your installing use the latest version.

Click here: How To Install Latest MySQL Server
Default root user created. But some time this ID cause issue, so we create new user and connection.

Login with root user and navigate to Users and Privilages.

Create new user of your choice. 

Click on Administrative Roles tab and select all the checkbox and click on apply . 

Click on home and create new connection and give the user id created(Uteg and its Password).

Click on Test Connection.

Login to new conneciton created and Create New Schema.

Now goto to Config directory and add the below details in local.properties in and save. Make sure whatever the user created above, same details you must use here.

dataSource.className=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
dataSource.driverClass=com.mysql.jdbc.Driver
dataSource.jdbcUrl=jdbc:mysql://localhost/datahub?useConfigs=maxPerformance
dataSource.username=uteg
dataSource.password=uteg​
Download the MySQL connector jar file.Click here. Place jar file in C:\Hyb6\hybris\bin\platform\lib\dbdriver

Now build the hybris again using ant clean all and start the server. In case first time then you need to initialize the system.
Thats it now your Hybris is running with MySQL database.
In the next blog we will see how to connect SAP ISU via DATAHUB.
To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply