Kodi Community Forum
2 XBMC PCs and 1 Database on the shared NAS - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Windows (https://forum.kodi.tv/forumdisplay.php?fid=59)
+---- Thread: 2 XBMC PCs and 1 Database on the shared NAS (/showthread.php?tid=70603)



- dora - 2010-09-30

mwkurt Wrote:Hello,
I believe that I tried the following:

mklink /d \users\Mark\AppData\Roaming\XBMC\userdata\Thumbnails \192.168.1.6\users\server\appdata\Roaming\XBMC\userdata\Thumbnails

Try to use double slash before the host ip:
mklink /d \users\Mark\AppData\Roaming\XBMC\userdata\Thumbnails \\192.168.1.6\users\server\appdata\Roaming\XBMC\userdata\Thumbnails

This folder should also be shared so before making the symbolic link to it. Try accessing this folder using windows explorer and see if you can. Create the symlink only after you manged to access it.


- alex84 - 2010-09-30

dora Wrote:I'm happy that my short instructions helped you.

Can anybody tell me why not using symbolic links for the whole userdata folder instead of using the external MySQL db?
I already asked it in a new thread (http://forum.xbmc.org/showthread.php?p=612485), but this thread is much more popular Wink so I'm sorry for asking agian.
What are the advantages of using MySQL? because, currently, It looks like it has more cons than pros.

This quote is taken from post 2# on the first page of this thread.

Quote:Some advantages of this setup:
Every PC or MAC running XBMC can access that central database even simultaneously (instead of using a local database for each instance of XBMC), avoiding the need to scrape movie info once per each XBMC. Also sharing the info of watched/unwatched movies/tvshows/musicvideos and any other info that XBMC stores in the media library database (like stop/resume bookmarks).

If you dont think that the mysql db is for you, then probobly it isn't, all depends on your needs. For me the mysql db is awsome, been wating for that for a long time now =)

Hope this helps


- dora - 2010-09-30

alex84 Wrote:If you dont think that the mysql db is for you, then probobly it isn't, all depends on your needs. For me the mysql db is awsome, been wating for that for a long time now =)

Maybe I wasn't clear enough. I also waited for a built in method to make many clients access one database.
Actually, I didn't wait for this feature to become available and I tried to achieve it using symbolic links.
Here are the details:
When using sqlite3 method (currently the default method), the db files are stored in userdata\Database folder (MyMusic7.db and MyVideos34.db).
If you want two xbmc clients to share the same db, all you need to do is make these two files point to the same files on the disk. You can achieve that by using symbolic links. It works even accross the network.
Once you do that, the two xbmc clients share the same db. When one of them updates the db, the other can see the change.
You can also share the whole userdata folder (like I did before the MySQL method became available). By doing that, you share also all your settings, not only the db.
Now, when the MySQL method became available, I decided to give it a chance but it looks like it has some problems, like the thumbnails cache and user profiles.
My question is what are the advantages of the MySQL method over sharing sqlite db files using symbolic links.
I still didn't get an answer for this question.


- mwkurt - 2010-09-30

Dora,

Thanks for the help with the links, I'll give them a try when I get home.

On another note, a couple of the advantages of using mysql are the ability to have watched flags synced across the different computers on your network. If you watch a program or movie on an extender in the living room, if you go to the bedroom and cruise through your library, you can see that you have already watched this movie. Another advantage is the ability to watch a video on one pc, stop half way through, go to another pc and resume from where you left off on the first pc. Of coarse you may not care about these two things, so they may not be that big of a deal.

Thanks,
Mark


- dora - 2010-09-30

mwkurt Wrote:On another note, a couple of the advantages of using mysql are the ability to have watched flags synced across the different computers on your network. If you watch a program or movie on an extender in the living room, if you go to the bedroom and cruise through your library, you can see that you have already watched this movie. Another advantage is the ability to watch a video on one pc, stop half way through, go to another pc and resume from where you left off on the first pc. Of coarse you may not care about these two things, so they may not be that big of a deal.

I've just made an experiment with sharing all the user data between two xbmc machines using symbolic links and the results are:
1. The watch flag is being shared between the two machines
2. You can continue watching a movie on the second machine from the same point you stopped on the first one.

I don't know anything about making a symbolic links on a mac but my guess is that it is possible.

so... here we go again... what are the advantages of MySQL over sharing userdata folder by using symbolic links?
I can see the potential and flexibility of external db server but currently I can see no advantages.


- myrison - 2010-09-30

Dora, I suspect, but don't know for certain, that if you just share the userdata folder you might run into file contention issues if two or more people are using it at the same time. MySQL has logic built in to deal with this as it happens, but I'm not sure what happens if you just share the same root folders. With that said, if it works for you as is, I guess run with it until you find a reason to change.


- mwkurt - 2010-09-30

Dora,

Thank you so much for your help!!!

The double slash "\\" did the trick!

I am sorry that I can't help you with why using mysql may be better than using links. Maybe it's not. It looks to be just as good. Someone with more experience than myself will have to chime in on this.

Thanks again,
Mark


Problem with duplicate paths - coolnicks - 2010-09-30

Hi All,

Just trying to get XBMC working with MySQL, but not having much luck, DBs are setup with correct character sets and collations, XBMC can talk to the DB fine. However, when I try to scan my TV shows, it dosent work very well at all, it only finds the first eppisode for some shows, and trys to insert lots of duplicate paths (path.strPath has a unique index).

When the scan has finshed, if I look in the files table there is only the first eppisode from a few shows.

Here is the log of it trying to insert multiples of the same path:

Code:
21:50:07 T:2964 M:1379332096  NOTICE: VideoInfoScanner: Starting scan ..
21:50:14 T:2964 M:1390153728   ERROR: SQL: Undefined MySQL error: Code (1062)
                                            Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\24\\','','')
21:50:15 T:2964 M:1389404160   ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\24\\','',''))
21:50:15 T:2964 M:1387954176   ERROR: SQL: Undefined MySQL error: Code (1062)
                                            Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\24\\','','')
21:50:15 T:2964 M:1387954176   ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\24\\','',''))
21:50:17 T:2964 M:1369280512   ERROR: SQL: Undefined MySQL error: Code (1062)
                                            Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\American Dad\\','','')
21:50:17 T:2964 M:1369280512   ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\American Dad\\','',''))
21:50:17 T:2964 M:1368559616   ERROR: SQL: Undefined MySQL error: Code (1062)
                                            Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\American Dad\\','','')
21:50:17 T:2964 M:1368559616   ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\American Dad\\','',''))
21:50:22 T:2964 M:1393586176   ERROR: SQL: Undefined MySQL error: Code (1062)
                                            Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\Black Books\\Black Books Series 1\\','','')
21:50:22 T:2964 M:1393586176   ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\Black Books\\Black Books Series 1\\','',''))
21:50:22 T:2964 M:1391017984   ERROR: SQL: Undefined MySQL error: Code (1062)
                                            Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\Black Books\\Black Books Series 1\\','','')
21:50:22 T:2964 M:1391017984   ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\Black Books\\Black Books Series 1\\','',''))

Does it query for the path first, and if not found insert it, is there a reason maybe it isnt finding it first?

EDIT: I think its this bug: http://trac.xbmc.org/ticket/9022

Any ideas?

Nick


- sloth - 2010-09-30

Hello,
I just tried to set up the mysql central database. I tested the the mysql-database with a php script and it exists, and is accessable with the username and password I set. However, when I start XBMC it cannot connect to it ("unable to open database xbmc_video"). This is my advancedsettings.xml file:
<advancedsettings>
<videodatabase>
<type>mysql</type>
<host>192.168.1.8</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
<name>xbmc_video</name>
</videodatabase>
</advancedsettings>
The database was created as suggested (CREATE DATABASE xbmc_video CHARACTER SET latin1 COLLATE latin1_general_ciWink.
Any ideas, what I am doing wrongly?

Best wishes,
Jonas


- myrison - 2010-10-01

did you try it with your firewalls totally off? Do at least that much to rule out that a firewall on either machine isn't contributing to the problem.


XBMC Thumbnails located on NAS? - flamez - 2010-10-01

I have xbmc storing my video database in mysql fine now! YEAH! but i would like to get my thumbnails stored there as well.

i am running xbmc dharma beta 2 live installed on HD on my Revo and i have my unRaid server storing my mysql video database on.

I have tried many ways to get this working and no luck so far!

I understand that i need to store them in a folder on my nas and not in mysql.

Any ideas to help me get this working?

Thanks for any help!

Flamez


- sloth - 2010-10-01

myrison Wrote:did you try it with your firewalls totally off? Do at least that much to rule out that a firewall on either machine isn't contributing to the problem.

Yes, the firewall is off. I am using XBMC Dharma beta 2 on OSX 10.6 and Windows 7. All media and the mysq 5.1.41 database are on a Ubuntu Server 9.04.


- alex84 - 2010-10-01

flamez Wrote:I have xbmc storing my video database in mysql fine now! YEAH! but i would like to get my thumbnails stored there as well.

i am running xbmc dharma beta 2 live installed on HD on my Revo and i have my unRaid server storing my mysql video database on.

I have tried many ways to get this working and no luck so far!

I understand that i need to store them in a folder on my nas and not in mysql.

Any ideas to help me get this working?

Thanks for any help!

Flamez

Check this out, question has been solved before mate...
http://forum.xbmc.org/showpost.php?p=605915&postcount=2

Cheers


- smiffy1989 - 2010-10-01

coolnicks Wrote:Hi All,

Just trying to get XBMC working with MySQL, but not having much luck, DBs are setup with correct character sets and collations, XBMC can talk to the DB fine. However, when I try to scan my TV shows, it dosent work very well at all, it only finds the first eppisode for some shows, and trys to insert lots of duplicate paths (path.strPath has a unique index).

When the scan has finshed, if I look in the files table there is only the first eppisode from a few shows.

Here is the log of it trying to insert multiples of the same path:

Code:
21:50:07 T:2964 M:1379332096  NOTICE: VideoInfoScanner: Starting scan ..
21:50:14 T:2964 M:1390153728   ERROR: SQL: Undefined MySQL error: Code (1062)
                                            Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\24\\','','')
21:50:15 T:2964 M:1389404160   ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\24\\','',''))
21:50:15 T:2964 M:1387954176   ERROR: SQL: Undefined MySQL error: Code (1062)
                                            Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\24\\','','')
21:50:15 T:2964 M:1387954176   ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\24\\','',''))
21:50:17 T:2964 M:1369280512   ERROR: SQL: Undefined MySQL error: Code (1062)
                                            Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\American Dad\\','','')
21:50:17 T:2964 M:1369280512   ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\American Dad\\','',''))
21:50:17 T:2964 M:1368559616   ERROR: SQL: Undefined MySQL error: Code (1062)
                                            Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\American Dad\\','','')
21:50:17 T:2964 M:1368559616   ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\American Dad\\','',''))
21:50:22 T:2964 M:1393586176   ERROR: SQL: Undefined MySQL error: Code (1062)
                                            Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\Black Books\\Black Books Series 1\\','','')
21:50:22 T:2964 M:1393586176   ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\Black Books\\Black Books Series 1\\','',''))
21:50:22 T:2964 M:1391017984   ERROR: SQL: Undefined MySQL error: Code (1062)
                                            Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\Black Books\\Black Books Series 1\\','','')
21:50:22 T:2964 M:1391017984   ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'O:\\Black Books\\Black Books Series 1\\','',''))

Does it query for the path first, and if not found insert it, is there a reason maybe it isnt finding it first?

EDIT: I think its this bug: http://trac.xbmc.org/ticket/9022

Any ideas?

Nick

I decided to setup syncing this morning but have that exact same problem :/


- flamez - 2010-10-01

alex84 Wrote:Check this out, question has been solved before mate...
http://forum.xbmc.org/showpost.php?p=605915&postcount=2

Cheers

Are those steps in that post preformed on the NAS box or Live Box?

Thanks