Page 1 of 1

commandline database access

PostPosted: Sun Oct 31, 2021 3:54 pm
by xnor
I'm trying to access my subsonic database via the command line and I having trouble figuring out the credentials.
According to the info here: http://hsqldb.org/doc/2.0/util-guide/sq ... l_int-sect
I've created an sqltool.rc file in my homedir (root) and have edited some details:
~/sqltool.rc

urlid subsonic
url jdbc:hsqldb:/var/subsonic/db

I can initiate the command line access via:
java -jar /usr/local/share/java/classes/sqltool.jar subsonic

But I'm not actually sure that the database path is correct (does it use the directory or the subsonic.data file?)
And I don't know what username/password to provide.
Any hints?

Re: commandline database access

PostPosted: Mon Nov 01, 2021 4:10 pm
by xnor
Okay, answering my own question..

i have a folder /var/subsonic/db/ that contains "subsonic.data" "subsonic.properties" etc etc

in ~/sqltool.rc i have:

Code: Select all
urlid subsonic
url jdbc:hsqldb:/var/subsonic/db/subsonic
username SA
password


with the subsonic process stopped, i can connect to the db via:
Code: Select all
java -jar /usr/local/share/java/classes/sqltool.jar subsonic

Re: commandline database access

PostPosted: Wed Nov 03, 2021 2:31 pm
by xnor
BTW, accessing the DB like this seemed to corrupt it.. even without running any queries.. so I ended up just using the db.view approach (I was migrating all my data to a different directory structure, maybe there is a better way)

Re: commandline database access

PostPosted: Mon Nov 08, 2021 3:06 pm
by acroyear
the corruption was likely a version mismatch between the hsql driver associated with the command-line tool and the version (likely old) of hsql that subsonic is using.

also, you have to make sure your subsonic instance is totally turned off (sudo service subsonic stop) or else you have concurrent reads/writes and that may also corrupt things.

I know i managed to get a 3rd party tool to view the structure at some point, but i haven't tried it in a while.