Alfresco – Using MySQL instead of PostgreSQL

Alfresco is a Free/Libre enterprise content management system for Microsoft Windows and Unix-like operating systems. It comes in 2 flavors – Community & Enterprise.Alfresco uses PostgreSQL by default. But most of the developers, including me, are well-versed with MySQL. Even after reading the documentation and going through the forums, I still spent considerable time to enable Alfresco, right after installation, to use MySQL.

I am pretty sure there are tons of others who are still facing similar problems. To them, I present a step-by-step procedure to install Alfresco Enterprise and use MySQL.

System Configuration

MySQL Installation

yum update
yum install mysql-server mysql
chkconfig mysqld on
/etc/init.d/mysqld start
mysqladmin -u root password <enter_password_here>

Database creation, user creation and granting privileges

mysql -u root -p
create database alfresco default character set utf8 collate utf8_bin;
create user 'alfresco'@'localhost' identified by 'alfresco';
grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;
grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;
grant all on alfresco.* to 'alfresco'@'%' identified by 'alfresco' with grant option;

Download MySQL connector for Java

cd /root
tar -xzvf mysql-connector-java-5.1.20.tar.gz
rm -f mysql-connector-java-5.1.20.tar.gz

Alfresco Enterprise Installation

You have to sign up on the Alfresco site to try Alfresco Enterprise. Once you sign in, a download link is provided in your email.

cd /opt
wget <enter_download_link_here>
chmod a+x alfresco-enterprise-4.0.1-installer-linux-x64.bin?AWSAccessKeyId=xxxxxxxxxxxxxxxxxxxx

This will start the installation. When it asks for installing PostgreSQL, specify ‘n‘. It will prompt for a few variables. Listed below are those variables and their values – 

JDBC URL: [jdbc:postgresql://localhost/alfresco]: jdbc:mysql://localhost:3306/alfresco?useUnicode=yes&characterEncoding=UTF-8
JDBC Driver: [org.postgresql.Driver]:
Database name: [alfresco]: alfresco
Username: []: alfresco
Password: :alfresco
Verify: :alfresco

Let it continue with the installation. It should take about 10 minutes. At the end, it asks for starting Alfresco. Specify ‘n‘.

Final Commands

Copy the MySQL connector to the Tomcat’s lib directory.

$ cp /root/mysql-connector-java-5.1.20/mysql-connector-java-5.1.20-bin.jar /opt/alfresco-4.0.1/tomcat/lib/

Make sure MySQL is running. Then start the Alfresco service.

$ service alfresco start

Follow all of the above steps in the same order. That’s it! Alfresco will now use MySQL instead of PostgreSQL.

This entry was posted in Technical and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s