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.
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 wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.20.tar.gz/from/http://mysql.skynet.be/ 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 ./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]: org.gjt.mm.mysql.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‘.
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.