atom feed7 messages in org.codehaus.grails.userRe: [grails-user] MySQL instead of HS...
FromSent OnAttachments
Arun GuptaApr 18, 2008 6:38 pm 
Guillaume LaforgeApr 18, 2008 6:42 pm 
Burt BeckwithApr 18, 2008 6:55 pm 
Arun GuptaApr 18, 2008 11:43 pm 
Fred JanonApr 19, 2008 12:08 am 
Burt BeckwithApr 19, 2008 7:39 am 
Burt BeckwithApr 19, 2008 7:41 am 
Subject:Re: [grails-user] MySQL instead of HSQLDB in WAR-based deployment
From:Burt Beckwith (bu@burtbeckwith.com)
Date:Apr 18, 2008 6:55:39 pm
List:org.codehaus.grails.user

A deployed war runs by default in 'prod' mode, and that datasource section is pointing to HSQLDB ('jdbc:hsqldb:file:prodDb;shutdown=true').

Also, it's best to specify the dialect when using MySQL to ensure you're using transaction InnoDB tables instead of MyISAM tables - add this to your config:

dialect = org.hibernate.dialect.MySQL5InnoDBDialect

Burt

On Friday 18 April 2008 9:39:12 pm Arun Gupta wrote:

I'm trying to deploy an app to use MySQL instead of HSQLDB and made the following changes to DataSource.groovy:

-- cut here -- dataSource { pooled = false driverClassName = "com.mysql.jdbc.Driver" username = "root" password = "" url = "jdbc:mysql://localhost/crud" } hibernate { cache.use_second_level_cache=true cache.use_query_cache=true cache.provider_class='org.hibernate.cache.EhCacheProvider' } // environment specific settings environments { development { dataSource { dbCreate = "create-drop" // one of 'create', 'create-drop','update' url = "jdbc:mysql://localhost/crud" } } test { dataSource { dbCreate = "update" url = "jdbc:hsqldb:mem:testDb" } } production { dataSource { dbCreate = "update" url = "jdbc:hsqldb:file:prodDb;shutdown=true" } } } -- cut here --

but seeing the following exception when the WAR is deployed:

-- cut here -- Caused by: org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: User not found: ROOT ... 29 more Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: User not found: ROOT ... 29 more Caused by: java.sql.SQLException: User not found: ROOT at org.hsqldb.jdbc.Util.sqlException(Unknown Source) at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source) at org.hsqldb.jdbcDriver.getConnection(Unknown Source) at org.hsqldb.jdbcDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(DriverManager.java:525) at java.sql.DriverManager.getConnection(DriverManager.java:140) ... 29 more -- cut here --

It seems like the application is not recognizing MySQL database configuration. I saw some pointers on the alias and have followed the advice but can't get past this error.

I'm running MySQL on MacOS Leopard with --user root. MySQL Connector/J jar is bundled in the lib directory already.

Is there some other change required to trigger the change from HSQLDB -> MySQL ?

--------------------------------------------------------------------- To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email