Home Grails auto-generate the database from the domain model
Reply: 1

Grails auto-generate the database from the domain model

Tahmid Saim
Tahmid Saim Published in 2018-01-08 10:29:19Z

I am trying to create a simple application using Grails(3.2) and MySQL in Netbeans. I have configured MySql in Grails project and also created a database, named "third" . After creating the domain class model, the controller (scaffolded) and the views for CRUD, my project is running but whenever I am trying to do any operation - screenshot of error

this error is occuring. I am unable to solve this problem and also tried manually creating "Person" table, but same error occuring.

Michal_Szulc Reply to 2018-01-12 20:22:26Z

Your stacktrace clearly states that your db with name third doesn't have proper table person. But you shouldn't create this table manually (if you already had - please remove all tables from your db)

Connection seems fine but you should take a look at dbCreate value in your application.yml.

dbCreate - Whether to auto-generate the database from the domain model - one of 'create-drop', 'create', 'update' or 'validate'


If you are using just simple command grails run-app to start server, then you should check out the value in the environments: development block.

Paste your application.yml content (without db credentials) if you need a personalized solution.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.318336 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO