Install Liferay 6 on Linux with external MySQL database


Liferay is bundled with HSQL database included, but you can install with external database usage enabled. Assume you have installation of MySQL and your linux distribution is not very different from Ubuntu, CentOS or other widely used.


First of all check your database server supports TCP connections in addition to default socket. You should have the following line uncommented in [mysqld] section of /etc/mysql/my.cnf configuration file:

bind-address		=

Next login to myql and create database and user:

$mysql -u root -p
mysql> create database lportal character set utf8;
mysql> grant all privileges on lportal.* to 'lportal'@'localhost' identified by 'lportal';

You must choose other password in order this is not your development couputer. Exit with Ctrl+D and start to setup the distribution

Download Portal SQL Scripts the following url:

unpack it somwhere you want and run MySQL creation script:

mysql -u lportal -p lportal < /path/to/place/you/unpacked/file/liferay-portal-sql-6.x.x-ce-ga1/create/create-mysql.sql


Download archive with tomcat budled from the following url:

Unzip it inside /opt directory

#cd /opt

sothat you will have data  license  readme.html  tomcat-7.0.23 dirs and files in  liferay-portal-6.x.x-ce-ga1


Remove Liferay generated stuff:

#cd /opt/liferay-portal-6.x.x-ce-ga1/tomcat-x.x.x/webapps/
#rm sevencogs* -rf

Create configuration file with name+path /webapps/ROOT/WEB-INF/classes/ and the following contents:

# MySQL 

Now start your liferray


and wait until browser opens, if it's not try open url http://localhost:8080 manually after few minutes. If you see nothing check tomcat log files:

#cat /opt/liferay-portal-6.x.x-ce-ga1/tomcat-x.x.x/logs/catalina.dddd-mm-dd.log

If you see broser widow with setup wizard you almost there and can do other stuff yourself.