Reputation: 31734
I am using play 2.1.1.
What I want is, when play starts it should also create a database.
So as said in documentation, in my evolution 1.sql
I added the line Create Database videos
. But instead I get the below error. (Which is obvious, as it is trying to connect to database which does not exist).
What should I do, so that play on start up, creates a database and then uses it? Currently it first tries to connect to a database and then call my evolution files.
Upvotes: 0
Views: 498
Reputation: 246
See: where-do-i-put-startup-code-in-play-framework
In there you connect to your mysql with the appropriate user / pw and create a database, you can use DDL for all your tables and predefined data.
Upvotes: 2