cancel
Showing results for 
Search instead for 
Did you mean: 

MySQL database other than 'alfresco'

cflong
Champ in-the-making
Champ in-the-making
While installing Alfresco Community 2.1 from the community-tomcat package, I have been unable to successfully connect to a mysql db named anything other than "alfresco".

I have attempted to set this with the db.url variable in custom-repository.properties as such:
db.username=testuser
db.password=password
db.pool.initial=10
db.pool.max=20

db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost/alfresco_test
where  the database was created as such:
create database alfresco_test;
grant all on alfresco.* to 'testuser'@'localhost' identified by 'password' with grant option;
grant all on alfresco.* to 'testuser'@'localhost.localdomain' identified by 'password' with grant option;

I have no trouble when using the same config/username/password with a database named "alfresco".  Is this a limitation of alfresco or are there additional configuration steps needed to actually use a different database name?
5 REPLIES 5

cflong
Champ in-the-making
Champ in-the-making
Some of the errors seen when connecting to "aflresco_test" database

10:08:26,433 ERROR [[Catalina].[localhost].[/alfresco]] Exception sending context initialized event to listener instan
ce of class org.alfresco.web.app.ContextListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryRepositoryBootstrap'
defined in class path resource [alfresco/core-services-context.xml]: Invocation of init method failed; nested excepti
on is org.alfresco.error.AlfrescoRuntimeException: Failure during rollback: org.alfresco.repo.dictionary.DictionaryRep
ositoryBootstrap$1@1abfd68
Caused by:
org.alfresco.error.AlfrescoRuntimeException: Failure during rollback: org.alfresco.repo.dictionary.DictionaryRepositor
yBootstrap$1@1abfd68
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:281)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:155)
        at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap.bootstrap(DictionaryRepositoryBootstrap.java:134
)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
.
.
.

sacco
Champ in-the-making
Champ in-the-making
Looks to me like your problem is in the two 'grant' instructions used to set up the database:  it should be something like this instead:

create database alfresco_test; 
grant all on `alfresco_test`.* to 'testuser'@'localhost' identified by 'password' with grant option;
grant all on `alfresco_test`.* to 'testuser'@'localhost.localdomain' identified by 'password' with grant option;

cflong
Champ in-the-making
Champ in-the-making
Nice catch.  You're absolutely right about the grants, but unfortunately that was a typo in my cleaning up the sql for the post.  I had the db names matching during each of my failed install attempts against mysql.

Does anyone else run Alfresco with a MySQL database name other than 'alfresco'??

sacco
Champ in-the-making
Champ in-the-making
Does anyone else run Alfresco with a MySQL database name other than 'alfresco'??

Yes, me.  One of my instances is called `alfresco$2_1$a` for example.

sergio
Champ in-the-making
Champ in-the-making
Hi all.

Hi can confirm and subscribe all the suggestions from sacco…

The only thing we have to do to run Alfresco2.1 with a Mysql database with the names of the schema and user different from the default ones is to modify the file custom-repository.properties as the following one:


db.username=alfresco_2_1
db.password=alfresco_2_1
db.pool.initial=10
db.pool.max=100

………..
db.url=jdbc:mysql://localhost:3309/alfresco_2_1

It does not matter to modify the repository.properties file in the web-app folder because the custom-repository.properties overwrites the default configuration. So, only one file to customize in order to have Alfresco using a database with custom name for the schema and user.

The DDL for creating the database, user and grants is the following:

create database alfresco_2_1;
grant all on alfresco_2_1.* to 'alfresco_2_1'@'localhost' identified by 'alfresco_2_1' with grant option;
grant all on alfresco_2_1.* to 'alfresco_2_1'@'localhost.localdomain' identified by 'alfresco_2_1' with grant option;

Just the same reported in the Alfresco documentation….

Obviously, if the mysql port is not the default one (3306), we have to specify the new port number into the db.url parameter, as the previous example. It is a common mistake not to indicate the port number when different from default.

All the best,

Sergio