init start-h2

The init start-h2 subcommand starts the in-memory H2 database included in the Liquibase installation package to get started and test how Liquibase works. It is available in Liquibase 4.7.0 and later.

If you run the liquibase init project command, you can use H2 only with one of the following options:

  • Creating the Liquibase project with the default values [Y].
  • Customizing the values [C] but keeping the default URL, username, and password.

The H2 database console opens automatically in a browser on port 9090 and requires a new command line or terminal window.

Syntax

To start the H2 database, open a new terminal window and run the following command:

liquibase init start-h2

To continue running commands, use another terminal window.

Command arguments

Note: Syntax for each parameter is specified in kebab-case (CLI and flow file), camelCase (properties file and JAVA_OPTS), and MACRO_CASE (environment variable).

Tip: For best results, specify all commands and parameters in the --kebab-case format in the CLI. If your preference is camelCase, it also works in the CLI.

Attribute Definition Requirements
--bind-address
liquibase.command.init.startH2.bindAddress
LIQUIBASE_COMMAND_INIT_START_H2_BIND_ADDRESS

Network address to bind to. Default: 127.0.0.1

Optional
--db-port
liquibase.command.init.startH2.dbPort
LIQUIBASE_COMMAND_INIT_START_H2_DB_PORT

Port to run h2 database on. Default: 9090

Optional
--launch-browser
liquibase.command.init.startH2.launchBrowser
LIQUIBASE_COMMAND_INIT_START_H2_LAUNCH_BROWSER

Whether to open a browser to the database's web interface. Default: true

Optional
--password
liquibase.command.init.startH2.password
LIQUIBASE_COMMAND_INIT_START_H2_PASSWORD

Password to use for created h2 user. Default: letmein

Optional
--username
liquibase.command.init.startH2.username
LIQUIBASE_COMMAND_INIT_START_H2_USERNAME

Username to create in h2. Default: dbuser

Optional
--web-port
liquibase.command.init.startH2.webPort
LIQUIBASE_COMMAND_INIT_START_H2_WEB_PORT

Port to run h2's web interface on. Default: 8080

Optional

Related links

For more information about using Liquibase and H2, see the following pages: