commandline database access

Need help? Post your questions here.

Moderator: moderators

commandline database access

Postby xnor » Sun Oct 31, 2021 3:54 pm

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?
xnor
 
Posts: 30
Joined: Tue Aug 02, 2011 8:54 pm

Re: commandline database access

Postby xnor » Mon Nov 01, 2021 4:10 pm

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
xnor
 
Posts: 30
Joined: Tue Aug 02, 2011 8:54 pm

Re: commandline database access

Postby xnor » Wed Nov 03, 2021 2:31 pm

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)
xnor
 
Posts: 30
Joined: Tue Aug 02, 2011 8:54 pm

Re: commandline database access

Postby acroyear » Mon Nov 08, 2021 3:06 pm

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.
--
Joe Shelby
http://subfiresuite.com/
http://subfireplayer.net/
User avatar
acroyear
 
Posts: 779
Joined: Wed Mar 27, 2013 8:05 pm
Location: Northern, VA


Return to Help

Who is online

Users browsing this forum: No registered users and 32 guests