Page 1 of 1

Modify Default admin User

PostPosted: Fri Aug 21, 2009 1:29 am
by wuhaa
Hi,

I have installed subsonic on my ubuntu server. I want to change the default user "admin" to a different login name (username) while retaining its admin privilege.

I think subsonic uses hsqldb to store this info. Its worth mentioning that I have very little knowledge of Java in general. So I googled for a manager interface fro the db. I found that hsqldb has this sort of built in and it can be invoked with

java -cp hsqldb.jar org.hsqldb.util.DatabaseManager

So the jar file sits in the subsonic/WEB-INF/lib/hsqldb-1.8.0.7.jar and the data file sits in subsonic/db/subsonic.data in case anyone is not aware as I was.

Anyhow I am unable to change this user "admin" as the Management utility does not show any data in that subsonic.data file. I am also unsure what the table names are as "Show Tables;" does not execute.

If anyone has managed to do this, please shed some light as to how to achieve this (preferably from the cli).

Thanks

PostPosted: Fri Aug 21, 2009 3:32 pm
by wuhaa
Is this not possible or no one has tried to do this...?

Maybe subsonic developers can comment....

PostPosted: Sat Aug 22, 2009 12:54 pm
by oxide[NL]
create a new user with full admin rights ^^

PostPosted: Sat Aug 22, 2009 3:16 pm
by wuhaa
I know that answer was coming... How do I delete the admin user after I have created the new user with admin rights?

PostPosted: Sun Aug 23, 2009 11:36 am
by oxide[NL]
good question, didnt figure that one out yet also
sorry mate

PostPosted: Sun Aug 23, 2009 1:15 pm
by jigsaw
wuhaa wrote:I know that answer was coming... How do I delete the admin user after I have created the new user with admin rights?


go to http://<YOUR_HOST>/db.view after you've logged in as the new admin user and run this SQL:
Code: Select all
delete from user where username = 'admin'


Keep in mind that many a application has some things which only applies for the user with the name admin. Deleting it could cause some issues for you, so you do it at your own risk :)

PostPosted: Sun Aug 23, 2009 8:24 pm
by wuhaa
Beautiful, that is what I was looking for. This interface can allow for a lot more modifications. Thank you for sharing that.

I do have a followup question to that. Is their a way to execute a command line query in hsqldb (something like java db.view "select *from user")...

By the way, Im running subsonic through tomcat 6

Thanks,

PostPosted: Sat Jan 08, 2011 10:48 pm
by indecline
4delete

Code: Select all
delete from user where username = 'admin'


4rename

Code: Select all
UPDATE user SET username='mom' WHERE username='admin'


dosent works

Code: Select all
Integrity constraint violation SYS_FK_51 table: USER_ROLE


thanks !