Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6063771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:12:20+00:00 2026-05-23T09:12:20+00:00

I have a grails project and my configuration points to a mysql database: DataSource.groovy

  • 0

I have a grails project and my configuration points to a mysql database:

DataSource.groovy
    environments {
        development {
            dataSource {
                dbCreate = "update"
                url = "jdbc:mysql://localhost/mydb"
                driverClassName = "com.mysql.jdbc.Driver"
                username = "root"
                password = "mypass"
                hibernate.dialect = "org.hibernate.dialect.MySQLDialect"
            } 
        }...

When Grails runs, (using grails dev run-app or grails run-app) it is not connecting to this development environment at all, but instead is using a default development environment. I know this because none of the data in the mydb database can be seen, and new entries into the db are not persisted in mydb. What am I doing wrong?

EDIT:

I get some error messages on startup that lead me to believe it is actually loading the right database:

2011-06-20 13:15:00,603 [main] ERROR hbm2ddl.SchemaUpdate  - Unsuccessful: alter table X add index FK9DBE53031937164 (a_id), add constraint FK9DBE53031937164 foreign key (a_id) references Y (id)
2011-06-20 13:15:00,607 [main] ERROR hbm2ddl.SchemaUpdate  - Can't create table 'mydb.#sql-2db_215' (errno: 150)

but see no indication that this would cause it to kick back to the default Grails environment or anything like that. Could this be related?

EDIT 2:

Config.groovy has the following:

environments {
    development
    {
        //Port
        grails.server.port.http = 9091

    }

but the application still runs on 8080.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:12:21+00:00Added an answer on May 23, 2026 at 9:12 am

    This was actually my problem (user error). It was pointing correctly to the correct database, but a series of problems caused the information to be written to a spot that made it look like it wasn’t being written. My fault! Thanks for the help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working now together with others in a grails project. I have to write
I'll soon start a new project in Grails in which I have to interact
I have not seen much support for Grails to develop facebook apps.I was just
I have a hibernate query in grails Book.findAllByRating(4) In the above query i want
I'm still learning Grails and seem to have hit a stumbling block. Here are
How do I create a grails war file so that it doesn't have the
I'm writing a small webapp in Grails and I have the following question regarding
I create Grails project use STS IDE . And sometimes i see not correct
I am working on a super sweet Grails project. I get simple tests, like
i m new to Grails and using some Shiro security. I have made a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.