SQlite database access

Ask all your questions regarding OC 5.x Please read the Support Forum Rules
Forum rules
ownCloud 5.x reached end of life and is officially unsupported. For details see Wiki page.

Please upgrade your ownCloud.
hyph
Newbie
Posts: 2
Joined: Thu Apr 12, 2012 1:03 pm

SQlite database access

Postby hyph » Thu Apr 12, 2012 1:08 pm

Not really knowing sqlite, I would be interested in getting SQL access to the DB created by owncloud.

Is it the file below subdir 'data': owncloud.db ?
Trying to "open" that with sqlite commandline tool says: no db or encrypted !?

After having access, I will try to figure out how to delete a group, which seems not to be possible in GUI!?
A proper SQL statement for that would be appreciated.
Thanks!

tschoie
Beginner
Posts: 23
Joined: Tue Feb 28, 2012 8:39 pm

Re: SQlite database access

Postby tschoie » Fri Apr 13, 2012 12:20 am

Hi there,

hyph wrote:Not really knowing sqlite, I would be interested in getting SQL access to the DB created by owncloud.

Is it the file below subdir 'data': owncloud.db ?

Yes.

hyph wrote:Trying to "open" that with sqlite commandline tool says: no db or encrypted !?
After having access, I will try to figure out how to delete a group, which seems not to be possible in GUI!?
A proper SQL statement for that would be appreciated.
Thanks!

I don't have any experience with the command line shell for SQlite, but one problem I could think of is file permissions. Did you make sure you have read/write permission for said file?
Other than that, I can only say I used SQLite Manager, a Firefox add-on (https://addons.mozilla.org/de/firefox/a ... e-manager/) to access the database and it worked really well.

Cheers,
tschoie

hyph
Newbie
Posts: 2
Joined: Thu Apr 12, 2012 1:03 pm

Re: SQlite database access

Postby hyph » Sun Apr 15, 2012 2:37 am

I tried to open it as root:
root@...:/var/www/owncloud/data# sqlite owncloud.db
Unable to open database "owncloud.db": file is encrypted or is not a database

But you are right, with the SQLite Manager addon, the file opens without problems.
And I was able to remove the group (and afterwards the assignments of users to that group - it seems SQLite does not manage foreign key constraints? Or owncloud does not use them?)

Thanks a lot!

User avatar
DarkSpider
Beginner
Posts: 32
Joined: Sun Apr 15, 2012 3:39 pm

Re: SQlite database access

Postby DarkSpider » Sun Apr 15, 2012 5:39 pm

Have you tried:
"sqlite3 owncloud.db" ?

It looks like a wrong sqlite client version.
check the version with:
"sqlite3 --version" or "sqlite --version"
my version is: 3.6.20

btw: I found two interesting links about sqlite commands: http://www.pantz.org/software/sqlite/sqlite_commands_and_general_usage.html
and
http://www.sqlite.org/draft/sqlite.html


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Community Edition 5.x and older”

Who is online

Users browsing this forum: No registered users and 3 guests