how to create new database in H2?

Suleman khan picture Suleman khan · Jun 23, 2014 · Viewed 26.4k times · Source

I have a site running locally on MySQL i want to run it on H2 database. I have just run h2.jar file for console on the browser but whenever I Log in I have seen the list jdbc:h2:/var/www/mysite/data/db; MODE=MySQL, information_schema and users.I can create tables in it but don't know how to create new database?

I am using Mode = MySQL type = H2 Database Engine in Embedded mode.

Answer

Dylan Gattey picture Dylan Gattey · Jun 23, 2014

From http://www.h2database.com/html/tutorial.html#creating_new_databases,

By default, if the database specified in the URL does not yet exist, a new (empty) database is created automatically. The user that created the database automatically becomes the administrator of this database.