Get ready to MySql for XBMC, want to confirm current way of setting it up


Recommended Posts

I have done plenty of reading here and on the XBMC forums about doing this.  So I know that some or all of this has been asked and answered in various posts, but instead of trying to piece things together by posting in several, I thought starting a fresh would aid in bringing it all together.

My setup consists of: UnRaid latest stable version 4.6 (final) updated 12/16/2010.  unMENU 1.3 installed since 9/2010 without any updates.  No other add-on's at this time.  Go script line added for unMENU to run at restart.  Static IP address.  12 hard drives with 2 user shares

My 3 XBMClives are on Zotac zbox HD-11's.  And Network is wired gig.

 

Questions that I have are:

 

1)  unMENU has Mysql listed the Packages, is this the best place to get started with the MySql?  Do I need any updates to unMENU before I would use it?  Is there anything else that I would need to do before hand?

 

2)  If understood correctly, MySql will be set up on 1 hard drive.  Does this mean that this drive will always be spun up because there is a process that is always running, or does it only get spun up when MySql is accessed by the XBMClives?  Would it make any difference (be it speed maybe) if the MySql was setup on its own disk, I could do this quite easily.

 

3)  Which brings me to the question of powerdown?  I had read that unRAID would not shut down correctly if you don't stop all processes, so will I need to setup anything more to be able to do a powerdown with MySql setup?  And then will I need to have something in my go script that restarts it when I power back up or is that something that would be handle by unMenu since it was install with it?

 

4)  XBMC question for someone that uses unRAID with the XBMClive.  What way did you deal with your thumbs and fanart since they are not stored in the database?

 

That's about all I can think to ask at the moment.

 

Appreciate all response.

 

Scott

Link to comment

I can answer a couple of these:

 

1.  That is all I did was install mysql from the unMENU package and configured the drive and password within its 'management' page once installed. 

http://lifehacker.com/5634515/how-to-synchronize-your-xbmc-media-center-across-every-room-in-the-house

Can't surf to this page at work but here is part of the link

contentwhores.com/media.../configuring-xbmc-to-use-a-mysql-library/

 

Once installed you can do management and queries with the following - http://www.mysql.com/products/workbench/

 

2. Disk1 is where it defaults too, but you can choose any disk not sure if it always spins or not.

 

3. I was going to ask this question as well in case of a power outage how to get the server to stop MySql to safely shut down using the UPS plugin.

 

4. I use XBMC on Windows, I did all my media in seperate folders as suggested here:

http://lifehacker.com/5393227/turbo-charge-your-new-xbmc-installation

 

Hope that helps a little.

 

Link to comment

Is this correct?

 

For 3) Found this info for powering up.  It came from here http://lime-technology.com/forum/index.php?topic=9078.0  Is this correct, or was it just what that person need.

 

Upon reboot you would need at a minimum:

 

cd /boot/packages

installpkg mysql-5.0.67-i486-1.tgz

cp /boot/my.cnf /etc/my.cnf

cd /usr ; echo "/usr/bin/mysqld_safe --datadir=/mnt/disk1/mysql/ --user=mysql" | at now

touch /mnt/disk1/mysql/.unmenu

 

This assumes the data directory was originally on disk1. 

It also assumes it is looking in /etc/my.cnf for configuration variables and you had previously saved your desired configuration in a file on the root of the flash drive (/boot/my.cnf)

 

Joe L.

 

And, Grizz1968 thanks for the reply had not seen that contentwhores before

Link to comment

 

4)  XBMC question for someone that uses unRAID with the XBMClive.  What way did you deal with your thumbs and fanart since they are not stored in the database?

 

 

Scott,

 

I did set this up at one point and abandoned it for this very reason.  At one point I put all the fanart and thumbs on Unraid and all clients pointed to that location.  However, the clients got very slow refreshing the UI since it had to go to unraid for all that assets.  I then tried a sync type of approach where the clients synced a common directory from Unraid to the local client, but things got out of sync a bit. 

 

This may not be useful for you, but I ended up switching to Plex which now has a centralized database approach that houses all assets and delivers them to all clients and the clients can cache the info until it changes.  Today it's OSX only, next year it'll be available on multiple platforms both on the client and on the server side...

 

Hope the first part gives you some ideas to try.

 

G

Link to comment
  • 1 month later...

To answer (4) I setup Dropbox as a sync mechanism since it's multi platform and it transfers files through local network. You still need all devices to have access to the internet account. Not ideal but it works great and Thumbnail folder is always in sync on all 3 computers (Live, Win 7 and OS X). I really hope this will change in the future with something simpler.

 

My problem at the moment is that I used the cache drive for the MySQL and it worked excellent until the first reboot when all databases appear empty. I'm not sure if this has something to do with using the cache disk. I used the unMenu interface and setup the script to auto install after reboot.

Link to comment

My mySql setup has been working great so far.  Though I must admit it was quite an undertaking, but in the end I'm a happy camper.

 

2) The mySql drive does spin down.  I had initially my spindown timer to 2 hours because when I watch a movie and it ends, it writes the "watched" flag back into the database.  If the drive had spun down, there will be a spinup delay before you can move around in the menu.

 

3) If you download the powerdown script, it does shut down mySql prior to turning off.

 

4) As for the thumbnails, I have each client's ~/.xbmc/userdata/Thumbnails directory symlinked to a location in unRAID, similar to what gbdesai mentioned.  I'm on a wired network as well and I haven't had any lag issues displaying thumbnails/posters/extrathumbs/backdrops.  Though on my wifi laptop, which for some reason tops out at 2Mbps transfer rate, is a little slow at displaying the images.

 

I like that Dropbox idea!  Though I have 2.4GB of thumbnails apparently so your mileage may vary.

Link to comment
  • 1 month later...

I have setup my unRaid server to be mainly a media tank for all my movies and TV. I have switched to a dedicated XBMC Live computer and an Apple TV 2 jailbroken with XBMC. I can see all my movies nicely all both devices.

 

I am intrigued in following Lifehacker's advice on how to synch XBMC library to remember your movie stop points. This requires the install of mySQL, and thus what is discussed in this topic.

 

http://lifehacker.com/#!5634515/how-to-synchronize-your-xbmc-media-center-across-every-room-in-the-house

 

Are there any other advantages to using the mySQL method other than the synch above? The setup looks daunting, and it is not quite spelled out for unRAID in Lifehacker's guide.

 

I am managing my XBMC library with Media Center Master where it stores all the scraped fanart and posters inside the folder with the movie. Basically I am following this tutorial - also from Lifehacker:

 

http://lifehacker.com/#!5505849/how-to-whip-your-movie-and-tv-show-art-into-shape-for-xbmc-and-boxee

 

The one nice thing that Media Companion seems to do over Media Center Master is that it scrapes the Actor thumbnails to a centralized folder. -(edit) I can confirm that this is NOT stored in centralized location.

Both my devices are connected via wired ethernet to the unRAID server... and my XBMC interface speed is quite fine.

 

So my question again, Does the use of mySQL have any other benefit other than synching my movie stop times to resume watching from any XBMC device. It seems like the scraped metadata is already stored in a common location.

 

Many thanks,

 

H.

 

Link to comment
Are there any other advantages to using the mySQL method other than the synch above?

For me, having my watched/unwatched synchronized across all my HTPC is just fantastic.  With hundreds of movies and thousands of TV episodes, it's nice to know that I don't have to browse through several synopses to figure out where I left off when I do switch (read: kicked out) from the living room.

 

It's not just the watched/unwatched flag.  Often times when I get a new TV episode or a movie, the synopsis is either short or nonexistent, and the posters and fanart are pretty lame or low-res.  Eventually I do want to update them and once I do, the changes are automatically reflected throughout each XBMC.  In fact, I only have one PC updating the library.  All the rest just connect to the DB and present whatever's there.

 

The setup looks dauting, and it is not quite spelled out for unRAID in Lifehacker's guide.

If I remember correctly, the only difference between the Lifehacker guide and setting it up for unRAID is obviously installing mySQL in a different OS.  The easiest way to do this is to install mySQL through the Unmenu Pkg Manager.  When installing via Unmenu, I'm pretty sure you can use this config:

 

First Database:  xbmc_video
Database User:  xbmc
Database User Password:  xbmc

 

And if you do that, I don't think you even need to do the command-line-fu in the Lifehacker guide (Step One after the installation).  If you do, you can access it by dropping this from telnet

 

mysql -u root -p

 

Then follow the rest of the guide as usual.  One thing I did different was I didn't export/import the library.  It acted... funny... from what I remember.  So I started over with a clean library on all my HTPC's.  Seemed to work better that way.

 

So assuming you've done all this.  Great!  The next thing you pretty much have to do, is sync the thumbnails.  Because for some reason, even if your media shares has the correct fanart.jpg/movie.tbn/etc., your secondary HTPC's will generate its own thumbnails and posters on media that have been pre-scraped.  Sounds confusing, but trust me when I say that thumbnails will get jacked up.

 

That post is going to have to appear another day, unfortunately.  Fb's got an early morning...

Link to comment

For those who are worried about keeping a drive spun up to run mysql, the easy solution is to get a cheap usb key and use that as the storage for the database. Low power, and fast enough for XBMC databases. I just mount the USB key in the go script before the mysql package gets installed.  I also rsync thumbnail cache to the same usb key.

Link to comment

Hi Bubba,

 

Many thanks for your reply. Very helpful.

 

I was able to install mySQL and configure it via unMenu. Then I downloaded the mySQL Workbench and installed it on my regular Win 7 PC (not an HTPC). The Workbench somehow allowed me a command prompt to the mySQL Server where I completed the Lifehacker tutorials. I also rebuilt my Media Library from scratch (not using export/import), I rebuilt it on my non HTPC Win 7 computer (with XBMC installed). Then on my Apple TV 2 I copied the xml file to the right folder and my media appeared quite nicely. I tested the "Resume from:xx" and it worked great...

 

My Living Room HTPC is an Atom Ion running XBMC live.

 

I am thinking that if I add any new movies now to my library, I will first scrape the info using Media Center Master, to get nfo, poster, and fanart. Then on my Win 7 computer, I will add to library. I hope this will update the mySQL library and the new movies will just appear on my 2 XBMC devices.

 

I have not yet tested my TV shows. I am not sure if the TV Shows will get synched to the XBMC-movies database... I will test that tonight.

 

Bubba, synching the thumbnails would be killer. I would really appreciate any pointers on how to do this. Once I have this done, if people are interested, I will write a detailed guide for how to do it all, crediting all parties.

 

SeeDrs.

 

Thank you also. I like the idea of the thumb drive... I have a lot to learn. I have to figure out how to mount the thumbdrive in the go script; how to install  mySQL to it, and how to share that so that the client machines will see it... I also must figure out how to create a Swap file since mySQL could run out of memory... I am up for it and I will also include how to do all this in the guide.

 

Thanks again guys.

 

H.

 

 

 

Link to comment

Sup H,

 

Glad you got mySQL worked out.  As far as thumbnail synching goes, it's going to depend on the HTPC's OS.  I can provide instructions on how I worked mine out for Windows, OSX, and Ubuntu, which hopefully is the same for XBMC Live.  On the other hand, I have no idea how or if it would work on ATV2.  What's the underlying OS?  Outside of XMBC, are you able to mount and browse SMB shares?

 

Anyway, I'll see about providing some instructions on the other 3 OS' after I review them myself.  Hopefully I can get them together in the next couple of days.

 

Also...

 

Then on my Win 7 computer, I will add to library. I hope this will update the mySQL library and the new movies will just appear on my 2 XBMC devices.

Technically, you don't need your Win7 machine to do the initial scrape after the update.  You can have either of the two HTPC's update the library's database.

 

I have not yet tested my TV shows. I am not sure if the TV Shows will get synched to the XBMC-movies database... I will test that tonight.

Yes, the TV Shows uses the same database as Movies.  And for me, it took a helluva lot longer to add (3-4 hours for ~3500 episodes I think?).  It's up to you but I would suggest waiting on that until the Thumbnail thing is taken care of.  Otherwise you may have to re-scrape them all over again, which may not be a huge deal.

Link to comment

Thanks Bubba,

 

It is probably best for me to update the library in Win7. When I get new movies I do it all from this machine. This way, when my wife or 6 year old son go into the HTPC, they don't have to update to see the new stuff... and I don't have to go into one of the HTPC myself to update.

 

ATV2 uses the iOS, which I take is quite similar to Apple OS... I have for the most part been able to figure out the equivalent paths... XBMC Live is a stripped down version of Ubuntu, thus your Ubuntu guide will be quite helpful.

 

The good thing is that I have all the fanart and metadata already stored with the movie. When this is present with the movie, I don't think XBMC goes online to scrape. This makes adding a bit quicker... I have 500 movies and about as many TV shows...

 

EDIT:

 

Just wrote a very comprehensive guide how to implement this:

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

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.