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


- tboooe - 2011-09-30

jays Wrote:Any way to import my library data into the new data layout? If I do an export on the main server install, install the nightly build, then do an import will that take care of it?

I "think" you have to first export your library, update all your XBMC clients/servers to the nightly then import your library. From what I recall, the nightlies database structure is not compatible with 10.1.


- constrictor - 2011-10-01

I apologize if this has already been asked, but I couldnt find any obvious threads through search.

I am very interested in having my XBMC database synchronized between my two machines, and attempted the MySQL method on my Windows Home Server. Either it just doesnt work on WHS 2011, or I just dont understand what Im doing so I just gave up.

So, my question is, why does it have to be so complicated? In a local install XBMC saves its internal database somewhere. Why cant there just be a setting to save that internal database to a shared network drive? I could have the database stored in a location that is accessible from all computers on my network and then for other installations of XBMC, I just point it to that location.

It doesnt matter what language the DBF is in, hell it could be in Excel format, all XBMC needs to know how to do is look elsewhere for its DBF. Why mess with having to install a whole program, configure it, and then have to edit XML files just to get XBMC to look elsewhere for its data.

What am I missing? It seems like the MySQL method is unnecessarily complicated.


- FreakinAye - 2011-10-01

constrictor Wrote:I apologize if this has already been asked, but I couldnt find any obvious threads through search.

I am very interested in having my XBMC database synchronized between my two machines, and attempted the MySQL method on my Windows Home Server. Either it just doesnt work on WHS 2011, or I just dont understand what Im doing so I just gave up.

So, my question is, why does it have to be so complicated? In a local install XBMC saves its internal database somewhere. Why cant there just be a setting to save that internal database to a shared network drive? I could have the database stored in a location that is accessible from all computers on my network and then for other installations of XBMC, I just point it to that location.

It doesnt matter what language the DBF is in, hell it could be in Excel format, all XBMC needs to know how to do is look elsewhere for its DBF. Why mess with having to install a whole program, configure it, and then have to edit XML files just to get XBMC to look elsewhere for its data.

What am I missing? It seems like the MySQL method is unnecessarily complicated.

file locking, among other reasons I'm sure.


- atari800 - 2011-10-01

Quote:Why mess with having to install a whole program, configure it, and then have to edit XML files just to get XBMC to look elsewhere for its data.
Performance
Multiuser capabilities
are a couple of primary reasons.

Installing MySQL and setup is not that difficult. There are tons and tons and tons of documents that all have the same steps for setting it up.
If you are a "I just want it to run" person or you dont have a need to have this setup... it does seem unnecessarily difficult.


- constrictor - 2011-10-01

atari800 Wrote:Performance
Multiuser capabilities
are a couple of primary reasons.

Installing MySQL and setup is not that difficult. There are tons and tons and tons of documents that all have the same steps for setting it up.
If you are a "I just want it to run" person or you dont have a need to have this setup... it does seem unnecessarily difficult.

I have a moderate to high level of computer knowledge, but absolutely no SQL experience. My attempt at loading MySQL was based on the walk through posted on Lifehacker.

I believe that walkthrough was assuming you were installing on a regular Windows workstation, rather than an actual server. Seeing as my library is stored on a WHS 2011 (basically Windows Server 2008), I assume there has to be differences.

Can you, or anyone, recommend a walkthrough that details what needs to be done on a Windows Server Machine? I would need MySQL to be setup as a service rather than an application, as the machine is rarely logged into by anyone.

I have both SabNZBd and Firefly Media Server running on it flawlessly! Smile


- jays - 2011-10-01

tboooe Wrote:I "think" you have to first export your library, update all your XBMC clients/servers to the nightly then import your library. From what I recall, the nightlies database structure is not compatible with 10.1.

Took the plunge this morning and decided to get the latest nightly working with my shared mysql database.

Started on the main server, exported my library then exited xbmc. Went into mysql and dropped the video and music databases and recreated them so Eden would have a clean slate to set up the tables. Installed last nights build, started the library import and went to pick my kid up from dance. By the time I got back it was at 98% but showed not responding. Luckily I just let it go because it did reach 100% and complete the import. Everything looked great on the server at this point so I simply installed the same build on the other two htpc's and they read the shares data perfectly.

One bug though, my recent movies imported perfect and in the order they were added but my recent tv shows are all out of order. Not a huge deal but figured I'd mention it.

For the poster trying to set this up, just install mysql just as the lifehacker article says. The only key is when you fire xbmc up you'll need to remove your sources if they were added as local drives and re-add them by browsing the network share. Lifehacker made no mention of this, but xbmc will not see any of your files once you switch it to mysql if your media sources aren't using network paths.


- Burbulence - 2011-10-04

For the WHS issues I'm interested in your solution if you find a way to get it working as I might be going down the same route... All I can think of that people usually forget Inc me on 2 setups! Is opening the inbound AND outbound port in your firewall for whichever port you assigned to mySQL in the install


- constrictor - 2011-10-05

Burbulence Wrote:For the WHS issues I'm interested in your solution if you find a way to get it working as I might be going down the same route... All I can think of that people usually forget Inc me on 2 setups! Is opening the inbound AND outbound port in your firewall for whichever port you assigned to mySQL in the install

I was able to make progress on this using my WHS server. You have to do this while in a Remote Desktop session on your server. You do not use the WHS Dashboard for any part of this process.

First step is to install MySQL from the server desktop using the Microsoft Web Platform Installer. Go here to downloaded the installer and load it on your server.

http://www.microsoft.com/web/downloads/platform.aspx

When the installer is loaded, you have to find MySQL 5.1 (I think thats the version) and install it. Its very straightforward, it will just install.

Once its installed, from the Start menu of your server you will have the MySQL command prompt. Load that up and login with your password you chose during the install process.

Once you are logged into the command prompt, go to this website and follow the instructions, step by step.

http://www.google.com/url?sa=t&source=web&cd=6&ved=0CEsQFjAF&url=http%3A%2F%2Fwww.contentwhores.com%2Fwordpress%2F%3Fpage_id%3D432&ei=MXaMTpDtBPGgsQKcv-zSBQ&usg=AFQjCNHOpoIMIXw82rDFi7YyiaSZXeq94A

The walkthrough at Content Whores mentions that you should export your library first, make sure you do that unless you plan on reimporting your entire library, which takes time.

You can connect to your MySQL database and maintain it using a GUI interface if you install MySQL Workbench:

http://dev.mysql.com/downloads/workbench/

You can either install Workbench on the server desktop itself, or on the desktop of another machine on your network. If you install it on another machine, you will only be able to login to your database using the 'root' account. The XBMC account you create wont have remove priveledges, but Im sure there is a way to grant them yourself.

Heres where it gets a little sketchy. My first attempt at getting this to work, I had problems getting XBMC to understand I had a remote MySQL library.

I ended up having to redo a couple of the steps to get it to finally work, and I did a couple of things out of order, so I dont know how much troubleshooting advice I can give you. I found another tutorial here that gives you more information for other platforms in case you need it.

http://lime-technology.com/forum/index.php?topic=11473.0

You may also need to open the firewall on your server to allow inbound and outbound access on port 3306. If you cannot connect to MySQL using either the Workbench on a remote PC or XBMC from the client computer, then this might be your problem.

So, in a nutshell, yes, you can get MySQL running on a WHS 11. It doesnt use any of the WHS features though. You are doing this from the server desktop as if your server was a Windows 2008 server.

On a side note, I haven't noticed any performance problems whatsoever. I have always used SMB shares and my entire library is externally parsed, so all of my thumbnails and fanart is stored on the network drive with the actual media files. My entire network is wired with Giganet connections and Cat6 cable, so the performance is very good.

Hopefully this helps, or at least helps just enough to get you the information you need to make it work for yourself.


- Sertis - 2011-10-25

I've noticed some oddities in the MySQL integration.

On the standard build on windows, the database created is "xbmc" which matches the <name>xbmc</name> tag used. In nightly builds on windows and Apple TV, the database created is "xbmc56" which is all fine and dandy between Windows and AppleTV. It appears that if you have an earlier version of the database, XBMC attempts to convert the database format into version 56 by appending 56 that to the <name> (instead of say creating temp tables and migrating in place). So far, it works fine on Windows and Apple TV, so I'm not too concerned.

Oddly though, the same advancedsettings.xml file on my iPad (10/22) uses "MyVideo56" as the database name, regardless of what's in the advancedsettings file. Each time the iPad launches, it attempts to create this database each time (then glitches out trying to create a database view). Does anyone know which iOS build plays well with MySQL?

Thanks.


- splnuts - 2011-10-25

Sertis Wrote:I've noticed some oddities in the MySQL integration.

On the standard build on windows, the database created is "xbmc" which matches the <name>xbmc</name> tag used. In nightly builds on windows and Apple TV, the database created is "xbmc56" which is all fine and dandy between Windows and AppleTV. It appears that if you have an earlier version of the database, XBMC attempts to convert the database format into version 56 by appending 56 that to the <name> (instead of say creating temp tables and migrating in place). So far, it works fine on Windows and Apple TV, so I'm not too concerned.

Oddly though, the same advancedsettings.xml file on my iPad (10/22) uses "MyVideo56" as the database name, regardless of what's in the advancedsettings file. Each time the iPad launches, it attempts to create this database each time (then glitches out trying to create a database view). Does anyone know which iOS build plays well with MySQL?

Thanks.

I just installed xbmc on linux mint and Im having the same problem. XBMC even crashes when trying to connect to the mysql server.


- sdsnyr94 - 2011-10-25

You need to use the latest nightly's, or compile yourself. There seemed to be a glitch from around 10-18 to 10-22 that had issues with the mysql database... but the devs have fixed it.


- bambi73 - 2011-10-25

sdsnyr94 Wrote:You need to use the latest nightly's, or compile yourself. There seemed to be a glitch from around 10-18 to 10-22 that had issues with the mysql database... but the devs have fixed it.
No, it's not fixed yet. Still doesn't work with sources from today around 20:00.


- DejaVu - 2011-10-26

Agreed. I have had to update my XBMCLive to Eden to keep up with IOS ATV2 build seeing as there incompatibilities.

I've given up with MySQL Database for now - 5 hours is too long for trying to just set this up!


- cyberwizzard - 2011-11-22

<me_too_mode>
I've just set up the shared database between my 3 HTPC's all running the Ubuntu Maverick version of XBMC. I think its 10.1 and the fact that I am using oneiric and maverick together does not seem to matter.

It took me 20 minutes to get it all to work.

Props to the devs who implemented this!


- logpace - 2011-11-29

So I saw that this was barely answered... I have everything up and running (i think) however i'm confused by the import step. Do I just import my saved library or re add the folders using smb or both? The reason I ask is because i assumed (maybe wrongly) that by exporting and importing my library that all m watched flags would be saved. Since i have ~500 movies and 80 seasons of tv shows I would really prefer to not do that. Maybe I just missed something?