Skip to content

Instantly share code, notes, and snippets.

@jbaranski
Created August 1, 2020 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbaranski/1273a6ad8613959ecba6ece9c232f32d to your computer and use it in GitHub Desktop.
Save jbaranski/1273a6ad8613959ecba6ece9c232f32d to your computer and use it in GitHub Desktop.
Add User and Password to Existing H2 Database

I needed to password protect an existing H2 database. I wanted to do two things:

  • Delete existing ADMIN user, who had no user name or password:

DROP USER "";

  • Create a new user, add a password for the new user:

CREATE USER IF NOT EXISTS example PASSWORD 'example password' ADMIN;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment