Kodi Community Forum
MySQL Database: Multiple XBMC HTPC's with 1 Shared Library - 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: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: MySQL Database: Multiple XBMC HTPC's with 1 Shared Library (/showthread.php?tid=85654)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29


- johnpatcher - 2011-03-30

TomPiXX Wrote:You could use different profiles for each user.

Could you elaborate on this? When I get it right you would have to create a new database for each user, which means that your data has to be scraped for each user separately Sad, although it seems that it is possible to create views between different databases in MySQL Wink.

Edit: When I've find some time to play with it, I definitely will try this.


Mysql Sync - dave.nasty - 2011-04-02

So I just created my first official HTPC and got everything set up for XBMC. I also have a laptop that I use XBMC on for other rooms in the house. I figured I would try to sync the libraries and as far as the Mysql part it seemed to go fine. However after I put the advancedsettings.xml in to the appdata\xbmc\userdata when I open xbmc I am unable to mark things as watched. Both PC's are running windows 7. I have enabled permissions to all. This is what is showing up in the XBMC log

special://profile/advancedsettings.xml are...
<advancedsettings>
<videodatabase>
<type>mysql</type>
<host>192.168.0.178</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
<name>xbmc_video</name>
</videodatabase>
<musicdatabase>
<type>mysql</type>
<host>192.168.0.178</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
<name>xbmc_music</name>
</musicdatabase>
</advancedsettings>
09:15:43 T:4748 M:2399367168 WARNING: VIDEO database configuration is experimental.
09:15:43 T:4748 M:2399297536 NOTICE: Getting hardware information now...
09:15:43 T:4748 M:2399297536 NOTICE: Checking resolution 12
09:15:43 T:4748 M:2399297536 NOTICE: Default DVD Player: dvdplayer
09:15:43 T:4748 M:2399297536 NOTICE: Default Video Player: dvdplayer
09:15:43 T:4748 M:2399297536 NOTICE: Default Audio Player: paplayer
09:15:43 T:4748 M:2399232000 NOTICE: Loading media sources from special://masterprofile/sources.xml
09:15:43 T:4748 M:2384994304 NOTICE: initializing playlistplayer
09:15:43 T:4748 M:2384994304 NOTICE: DONE initializing playlistplayer
09:15:43 T:4748 M:2378702848 NOTICE: CApplication::UpdateLibraries - Starting video library startup scan
09:15:43 T:4748 M:2378555392 NOTICE: initialize done
09:15:43 T:4748 M:2378555392 NOTICE: Running the application...
09:15:43 T:4748 M:2378534912 NOTICE: ES: Starting event server
09:15:43 T:4384 M:2378526720 NOTICE: ES: Starting UDP Event server on 127.0.0.1:9777
09:15:43 T:4384 M:2378489856 NOTICE: UDP: Listening on port 9777
09:15:43 T:1672 M:2378477568 NOTICE: VideoInfoScanner: Starting scan ..
09:15:44 T:1672 M:2378407936 NOTICE: VideoInfoScanner: Finished scan. Scanning for video info took 00:00
09:15:55 T:4748 M:2347704320 ERROR: SQL: Undefined MySQL error: Code (1062)
Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'J:\\Movies\\2 Fast 2 Furious (2003)\\','','')
09:15:55 T:4748 M:2347679744 ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'J:\\Movies\\2 Fast 2 Furious (2003)\\','',''))
09:15:56 T:4748 M:2334646272 ERROR: SQL: Undefined MySQL error: Code (1062)
Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'J:\\Movies\\310 to Yuma (2007)\\','','')
09:15:56 T:4748 M:2334646272 ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'J:\\Movies\\310 to Yuma (2007)\\','',''))
09:15:57 T:4748 M:2344587264 ERROR: SQL: Undefined MySQL error: Code (1062)
Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'J:\\Movies\\9 (2009)\\','','')
09:15:57 T:4748 M:2344587264 ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'J:\\Movies\\9 (2009)\\','',''))
09:15:57 T:4748 M:2339127296 ERROR: SQL: Undefined MySQL error: Code (1062)
Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'J:\\Movies\\10.Things.I.Hate.About.You.(1999)\\','','')
09:15:57 T:4748 M:2339127296 ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'J:\\Movies\\10.Things.I.Hate.About.You.(1999)\\','',''))
09:15:58 T:4748 M:2327367680 ERROR: SQL: Undefined MySQL error: Code (1062)
Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'J:\\Movies\\The 13th Warrior (1999)\\','','')
09:15:58 T:4748 M:2327367680 ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'J:\\Movies\\The 13th Warrior (1999)\\','',''))
09:15:59 T:4748 M:2324729856 ERROR: SQL: Undefined MySQL error: Code (1062)
Query: insert into path (idPath, strPath, strContent, strScraper) values (NULL,'K:\\Movies\\22.Bullets.(2010)\\','','')
09:15:59 T:4748 M:2324729856 ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath, strContent, strScraper) values (NULL,'K:\\Movies\\22.Bullets.(2010)\\','',''))
09:16:43 T:4904 M:2202316800 NOTICE: -->Python Interpreter Initialized<--
09:16:44 T:4904 M:2201538560 NOTICE: {'limit': '4'}


I have gone as far as uninstalling and restinstalling mymsql from scratch and trying the whole process again.
Thank you for any help you can give.


- joelones - 2011-04-08

just wondering what others do.
i configured the central database but how do you guys perform regular maintenance tasks remotely, i.e., remove a show from the library that needs to be rescanned without doing so with the remote in front of the tv.
in other words, is there some interface available that mimics the context item "remove from library"?


- bossanova808 - 2011-04-08

I posted a summary of all the XBMC MySQL optimisations I have found:
http://xbmcstuff.bossanova808.net/2011/03/summary-of-xbmc-mysql-database.html


- johnpatcher - 2011-04-08

joelones Wrote:just wondering what others do.
i configured the central database but how do you guys perform regular maintenance tasks remotely, i.e., remove a show from the library that needs to be rescanned without doing so with the remote in front of the tv.
in other words, is there some interface available that mimics the context item "remove from library"?

As far as I can tell you can't do this right now. But maybe there will someone come up with something like this.


- smeehrrr - 2011-04-09

johnpatcher Wrote:As far as I can tell you can't do this right now. But maybe there will someone come up with something like this.

I'm not sure I really understand the question, but I just run a copy of XBMC on my desktop PC for times when I want don't want to use the remote for something.


- joelones - 2011-04-10

smeehrrr Wrote:I'm not sure I really understand the question, but I just run a copy of XBMC on my desktop PC for times when I want don't want to use the remote for something.

very true, could easily just install a copy on my local machine, thanks for the suggestion


- blademansw - 2011-04-15

Well, I have just got mine setup as follows:

NAS Server
Evesham Technology Desktop
Athlon X2
4GB RAM
SATAII, 1TB drive
Gigabit Ethernet
Fedora 14 + Amahi

As Amahi is a LAMP server, you dont need to do anything much extra to MySQL to make everything work, except ensuring your xbmc user account has owner access to the XBMC databases.

The things I have learnt
Make sure you use SMB notation in your sources.xml
PHP Code:
smb://user:password@hda/music/ 

I setup a user called xbmc on the Amahi server, and granted read permissions to all the media shares. I am working on a least priviledge approach!

I used the optimisations here to ensure that MySQL was running sweetly.

It took a couple of rescan's to get everything right, and I changed the paths to use the SMB notion in sources.xml. This meant I had to dump ALL of the information in the Music table and start scanning the music again.

Here's some SQL to drop everything in your music table!
PHP Code:
DELETE FROM `xbmc_music`.`album`;
DELETE FROM `xbmc_music`.`albuminfo`;
DELETE FROM `xbmc_music`.`albuminfosong`;
DELETE FROM `xbmc_music`.`artist`;
DELETE FROM `xbmc_music`.`artistinfo`;
DELETE FROM `xbmc_music`.`content`;
DELETE FROM `xbmc_music`.`discography`;
DELETE FROM `xbmc_music`.`exartistalbum`;
DELETE FROM `xbmc_music`.`exartistsong`;
DELETE FROM `xbmc_music`.`exgenrealbum`;
DELETE FROM `xbmc_music`.`exgenresong`;
DELETE FROM `xbmc_music`.`genre`;
DELETE FROM `xbmc_music`.`karaokedata`;
DELETE FROM `xbmc_music`.`path`;
DELETE FROM `xbmc_music`.`song`; 

I also setup a baseline advancedsettings.xml which will be used on all XBMC machines, to ensure consistent settings for remote control etc.

I still have 35 gig of music to tag properly, I have done 15 gig so far, including embedding cover art in the MP3 files, and using a folder.jpg in each album folder. This seems to work very nicely.

The only thing I haven't had much success with is running XBMC on my Jailbroken iPod Touch 3G, I have all the sources setup and it talks perfectly to MySQL and finds the files OK. MP3 playback is terrible, keeps jumping. I think perhaps the iPod does not have enough performance to run XBMC.


Help setting up central DB - netsrac - 2011-05-02

OK I have finished building my File server

I am using the Norco 4224 and have Raid 10 set up with just under 6 TB of space using 6 x 2TB drives.

I am using Intel server board SE7520AF2 (Has built in Video) 2x2.8 Ghz Zeon CPU's + 8 Gig RAM.

I am running Windows Server 2008 (set-up as a file server)

Is there any way I can install XBMC on my server? I keep getting an error which I have read is due to the built-in display adapter (ATI* RAGE* XL SVGA PCI video controller with 8 MB of video memory)

I have the latest drivers installed have latest DirectX.

I will not be watching anything from this server directly, I am using it strictly for streaming video.

My goal:

  1. Single place to store database
  2. Single place to store artwork
  3. Single place to keep watched shows updated.

Items 1 & 3 can be accomplished if I use my desktop, but would rather keep information on my server and share it amongst my 3 HTPC's.

Worst case scenario I would buy a new video card but would still have to find a way to share artwork.

I have a lot of different movie series and I find that I end up having to rename the titles in order to get them to sort together (ie James Bond Movies)

Artwork is another problem as I get the wrong language thumbnail and have to change it manually.

These 2 extra steps I have to do on every HTPC.

It would be great to have one centralized place to store all data.

Thanks


- claypigeon - 2011-05-02

Quote:Is there any way I can install XBMC on my server?
probably, but why would you need to?

you can do what you are trying to do just by creating a shared thumbnails directory.

Create a Thumbnails directory on your fileserver

Mount them on your clients

Build symbolic links to replace to ~/userdata/Thumbnails directory, you can do this on linux and windows

Done, you have shared thumbnail art


- TugboatBill - 2011-05-03

The only reason to load XBMC on a server is if you want to update the database from there instead of clients. Alas, XBMC won't start with some of the video hardware that comes on server boards as well as most VMs. If you really have to install it on your server buy a cheap nvidia video card.


- claypigeon - 2011-05-03

netsrac, one more thing, I looked back at your post, and you didn't say anything about having mysql installed on your server. If you are going to create a shared database you need to install that too. The shared thumbnail stuff I outlined is done via SMB but you cant or shouldn't try to use file based sharing of your xbmc database between xbmc instances.


- netsrac - 2011-05-03

claypigeon Wrote:netsrac, one more thing, I looked back at your post, and you didn't say anything about having mysql installed on your server. If you are going to create a shared database you need to install that too. The shared thumbnail stuff I outlined is done via SMB but you cant or shouldn't try to use file based sharing of your xbmc database between xbmc instances.

I know that I need to install mysql, but did not as I could not get XBMC to work on my server.

I rip my DVD's from my desktop and scrap all the info.

When I put my James Bond collection, the movies ended up all over the place, because it got titled by the name of the movie.

I had to go and change all the titles (not the file name) to 007-1969: title, 007-1972: title and so on (23 times) and I had to do this on each HTPC, further more I wanted the collectors edition thumbnail, so I had to change all the thumbnails on all the HTPC's.

I know it is a one time thing, but I just moved all my movies to my server and find I have to do everything again. I still have another 500 movies to add to my server and hoping not to have to make the same changes on each HTPC.

I have 2 HTPC's running W7 and one running Ubuntu.

I will have to look into symbolic links for my thumbnails.

I am starting to think that maybe I should use those scrapers that put all the information into folders, but 75% of my collection is not in seperate folders as it needs to be for that to happen. ie my folder names are action, drama, comedy etc.


- Krazypoloc - 2011-05-12

netsrac Wrote:I know that I need to install mysql, but did not as I could not get XBMC to work on my server.

I rip my DVD's from my desktop and scrap all the info.

When I put my James Bond collection, the movies ended up all over the place, because it got titled by the name of the movie.

I had to go and change all the titles (not the file name) to 007-1969: title, 007-1972: title and so on (23 times) and I had to do this on each HTPC, further more I wanted the collectors edition thumbnail, so I had to change all the thumbnails on all the HTPC's.

I know it is a one time thing, but I just moved all my movies to my server and find I have to do everything again. I still have another 500 movies to add to my server and hoping not to have to make the same changes on each HTPC.

I have 2 HTPC's running W7 and one running Ubuntu.

I will have to look into symbolic links for my thumbnails.

I am starting to think that maybe I should use those scrapers that put all the information into folders, but 75% of my collection is not in seperate folders as it needs to be for that to happen. ie my folder names are action, drama, comedy etc.

Yeah you are doing a lot of things non standard (read wrong). This will cause some massive issues, headaches, and unneeded work....I really should make a more complete guide for this as I just re-did my entire XBMC configuration as I was having issues with a bug. Now everything is working better than it ever did and I think the cause is doing thing correctly and more importantly doing them in a certain order. For example this time around before I scraped any content I created my Symlinks folder for thumbnails, setup the XBMC databases on the MySQL sevrer, and configured one client to connect to the SQL server before scraping with that client. Then I changed to the skin I wanted and set up all the settings there. After that I scaped Movies, TV Shows, Music, and added other shares that do not get scanned into the library. After that I made sure eveything looked good and was working properly. I then copied the sources.xml and advanced settings.xml files to the other client machines, so all I have to do is configure the skin settings instead of having to add all the sources a second time, which could lead to user error....

Oh also I had all my movies in one folder before moving to XBMC. I used a free application called file to folder...which I can not find now for the life of me....


- rocketpants - 2011-05-13

netsrac Wrote:I rip my DVD's from my desktop and scrap all the info.

When I put my James Bond collection, the movies ended up all over the place, because it got titled by the name of the movie.

Have you tried using Ember, or similar, for the metadata management and creating a set for series like James Bond? http://wiki.xbmc.org/?title=Movie_Sets