[Solved] How to insert user into database via CLI

Unimus support forum
Post Reply
egarnel
Posts: 2
Joined: Thu Dec 13, 2018 4:12 pm

Thu Dec 13, 2018 4:17 pm

Hi,

New to Unimus and really like it. Unfortunately, I forgot to write my password down to the GUI.
Using HSQL backend and would like to add another user to get access.
Following the following URL: https://wiki.unimus.net/display/UNPUB/R ... t+password

It does not say "how" to access the db to create the user.
Any help would be appreciated
User avatar
Tomas
Posts: 707
Joined: Sat Jun 25, 2016 12:33 pm

Thu Dec 13, 2018 4:29 pm

Hi,

You can use database editing tools such as DBeaver or RazorSQL - they both support HSQL.

Your database is located on-disk, by default in:
/etc/unimus/hsql
C:\ProgramData\Unimus\hsql

You can open the DB using these tools and change the user's password as described in the article.

We do NOT recommend adding another user to the DB manually - you will compromise database integrity.
(there is more to user creation than just adding a row to the SYSTEM_ACCOUNT table).
Instead reset the password to the original user and properly create new users using Unimus "User Management" menu.
egarnel
Posts: 2
Joined: Thu Dec 13, 2018 4:12 pm

Thu Dec 13, 2018 5:17 pm

Messed with RazorDB for a bit, had to spin up a graphic interface - was running this headless.
I will just re-install Unimus and start over
This time I will remember to record the password (thought I did)
User avatar
Tomas
Posts: 707
Joined: Sat Jun 25, 2016 12:33 pm

Thu Dec 13, 2018 5:31 pm

Sorry about that - did not notice you were looking specifically for a CLI tool.
For direct CLI use, there is "hsqldb-sqltool".
It is a little painful to deal with tho.

Personally, I use the GUI tools when dealing with HSQL.
Since HSQL is a file-based database, you can just transfer the DB files to a PC with a GUI, edit the DB, and transfer the DB files back to the server. (of course Unimus needs to be shut down during this procedure)
Post Reply