How to set up my own password for accessing the h2 while working in embedded mode?
(if anyone confused - talking about the root password for accessing the database)
In Eclipse it seems that password assignment occurs at the moment of db connection creation which in turn launches the process of schema creation, where we provide username and password.
Even if this is true how to change existing password after set up? I've searched in information schema - found `users', there is no password column though.
The process seems to be really weird, what am I missing. In PostgreSQL it is a way easier.
So the questions are:
The passwords are assigned upon new schema creation?
How to change the password for current user?
I suspect it is done via the query, I believe it will have specific syntax, if that is the case I would appreciate sample query too, as I am not yet famillar with this SQL implementation.
For example, H2database . new_user_name is the new user name to be created. new_password is password for the new user. existing_user is the existing user name.
Accessing the H2 Console H2 database has an embedded GUI console for browsing the contents of a database and running SQL queries. By default, the H2 console is not enabled in Spring. Then, after starting the application, we can navigate to http://localhost:8080/h2-console, which will present us with a login page.
Oh I guess life is not that bad :-).
Found on:
http://www.h2database.com/html/grammar.html#alter_user_set_password
To change it we obviously have to be able to connect to database(know username and password), as I said these are the ones we use during connection set up.
Then create simillar sql snippet ALTER USER admin SET PASSWORD 'superPw';
I personally believe these high level operations have to be allowed to be done in wizards. Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With