Configure database with liferay

By default liferay use hsql database. To override this default behavior we can configure to different database of our own interests. Here we are going to show that how can we configure MySQL with Liferay Portal. This is pretty simple database and its free of cost. That's why its taken for this example.



Before configuring MySQL with liferay be sure that you have installed MySQL in your local machine. If you have not installed download it from http://www.mysql.com/downloads/ and follow the following steps.

Step 1:
Open your note pad and save it any where in your local machine with a file name "portal-ext.properties". Now add the following contents in your empty "portal-ext.properties" file.

jdbc.default.driverClassName=com.mysql.jdbc.Driver

jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root

If you don't have knowledge on database just remember the following
lportal is the database that liferay is going to use. So lportal schema should be created in your MySQL.

root is the user name and password for your MySQL server. It can be different in individual machine. So replace it with your user name and password.

Step 2:
Now copy "portal-ext.properties" and past inside liferay-portal-6.0.6\tomcat-6.0.29\webapps\ROOT\WEB-INF\classes folder

That's all. Start your server. If MySQL is connected successfully it will populate liferay tables inside the schema "lportal" as mentioned above.

2 comments: