Location of media library database on v4.3.5? How to access?

Please post your questions about using the web-based Photo, Music, Video Stations here.
Locked
kassi
New here
Posts: 2
Joined: Sat Nov 24, 2018 5:49 am

Location of media library database on v4.3.5? How to access?

Post by kassi »

Hi all!

I'm facing the problem (like many others, too) that my TS-453Be running on v4.3.5.0760 (the current version so far) never finishes to build up my Multimedia Library.
I set up the media folders and activate the multimedia library.
It starts to build up the database immediately. So far, so good.
After a while, the entries on the media folder screen disappear, and the background job for indexing doesn't show how many files are still to go, just something like "Generating Thumbnails blabla.jpg".
This will last forever ...

I read in the forum that you can open the SQLite database to analyse at which file the indexing crashes.
But since I'm using v 4.3.5, there's no SQLiteDB anymore, but moved to MySQL.

But where is this DB stored?

I assumed that it should be in /share/CACHEDEV1_DATA/.system
There, I found a file mediadb2.xml with this content:

Code: Select all


<?xml version="1.0" encoding="utf-8"?>
<MEDIADB>
<MEDIAFOLDER PATH="music/" MOUNT="/share/CACHEDEV2_DATA/" DB="s01" METADATA="/share/CACHEDEV1_DATA/" MASK="9" SUBTYPE="0" SECURE="0" TRANSCODETARGET="0" OPTIONS="0"/>
<MEDIAFOLDER PATH="photo/" MOUNT="/share/CACHEDEV2_DATA/" DB="s01" METADATA="/share/CACHEDEV1_DATA/" MASK="6" SUBTYPE="0" SECURE="0" TRANSCODETARGET="0" OPTIONS="0"/>
<MEDIAFOLDER PATH="video/" MOUNT="/share/CACHEDEV2_DATA/" DB="s01" METADATA="/share/CACHEDEV1_DATA/" MASK="2" SUBTYPE="0" SECURE="0" TRANSCODETARGET="0" OPTIONS="0"/>
</MEDIADB>
So the MultimediaDB should be located in /share/CACHEDEV1_DATA/.system/data/s01
And yes, there are many *.MYD, *MYI file and so on. Looks good.

But in MyPHPAdmin, this DB doesn't show up.

How can I access the DB?

Any advice appreciated,
Kassi
User avatar
glenintenn
Getting the hang of things
Posts: 64
Joined: Sat Dec 01, 2018 9:48 am

Re: Location of media library database on v4.3.5? How to access?

Post by glenintenn »

Hitting the same thing here ... none of the mysql executables I've found via SSH/command line seem to be the properly configured MariaDB instance that it appears QNAP uses for its internal mysql databases. some of the various my.cnf files you find on the system indicate the mysql instance has been set to port 3310 (compared to the typical default of 3306)

I also tried setting up an ODBC driver on one of my Windows systems on the same network as the QNAS. Even after finding some of the mysql utilities scripts and turning on TCPIP access on the internal mysql server (script runs without error), I was not able to hit the mysql instance on the QNAS.... the system's firewall is not open to get to the internal mysql instance. I would guess if you enable SQL Server via the QNAS control panel, it's setting up a separate instance of the database so you have no option to connect to one which is managing your QNAS internally.

Hopefully I'm wrong about some of these assumptions but... so far no progress on getting connected to the mysql instance running internally.

Of course, that doesn't even get to the issue of what the mysql root password might be (is it the admin pw on the QNAS box? (doubt it) )

Would be great first step if someone has found how to run command line mysql client (or how to connect into the mysql instance on their QNAS box). I have to believe that not having access to some of this wouldn't be acceptable to a QNAS admin in a commercial environment but I would also guess that much larger QNAS systems are running more standard versions of Linux too. I'm just two weeks into QNAP.

GL
GiT
QNAP TS-231P2-4G
QTS 5.0.1.2276
kassi
New here
Posts: 2
Joined: Sat Nov 24, 2018 5:49 am

Re: Location of media library database on v4.3.5? How to access?

Post by kassi »

Hi together!

I managed to access the media DB by copying the directory /share/CACHEDEV1_DATA/.system/data/s01 to another linux box with mysql installed. After changing the ownership (chown) I could access the DB.
So far, so good.

Unfortunately I could not find any oddities inside the DB.

So back to my original issue: The Indexing prcoess gets stuck and I don't know why or where ...
There's a log file /var/log/mymediadbserver.log
There I could find some errors including the corresponding file names.
There were different issues but I assume it's all about "dirty file system".
I just moved the directories with issues to my PC and restarted the Media DB Scan.
After some iterations, the scan finished successful.
So turned on the real time scan and copied back the directories which I moved to my PC. They were real time indexed fine; so problem solved :-)

About "different issues with file system":
When I moved the directories to my PC, there was one directory refusing to be deleted via SMB. I was only possible as admin on shell "rm -rf /share/.....blabla".
Another directory refused to be copied back, so I renamed it. Then everything was fine.

All in all, I do not really know the exact root cause why the scan always got stuck but it seems to be related to something with the file system. Removing the files from the volume and writing them back solved the issue.

Strange but satisfied ;-)
Regards,
Kassi
User avatar
glenintenn
Getting the hang of things
Posts: 64
Joined: Sat Dec 01, 2018 9:48 am

Re: Location of media library database on v4.3.5? How to access?

Post by glenintenn »

hehe. good thinking. i guess you got lucky on the mysql db version (qnap versus what you use) and such. i'll have to play with that on wampserver and see how it does.

thanks for posting your findings. that could be some useful information if things go haywire down the road.
GiT
QNAP TS-231P2-4G
QTS 5.0.1.2276
tombaythefog
New here
Posts: 6
Joined: Thu Mar 26, 2020 3:35 pm

Re: Location of media library database on v4.3.5? How to access?

Post by tombaythefog »

If you do netstat -at | grep 3310 you see that the server is only accepting connections on the localhost address. (this is on 5.0. system but sure it was the same 4 years ago %-)
[~] # netstat -ant|grep 3310|grep LISTEN
tcp 0 0 127.0.0.1:3310 0.0.0.0:* LISTEN
[~] # grep 127 /usr/local/mariadb/my-mariadb.cnf
bind_address = 127.0.0.1

You can change this to 0.0.0.0 and then you could use mysql client from anywhere. HOWEVER you are then exposing your db to no local sources.
User avatar
OneCD
Guru
Posts: 12144
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: Location of media library database on v4.3.5? How to access?

Post by OneCD »

* topic locked to prevent further necroposting *

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
Locked

Return to “Photo Station, Music Station, Video Station”