[AppleTV2] MySQL database / library support?

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
joshua.lyon Offline
Donor
Posts: 68
Joined: Dec 2009
Reputation: 0
Location: North Texas
Post: #251
Blaxxor Wrote:My other installations are all the most recent offical.

But I have nog previous experience of what you asking. Too bad. Would really like to have XBMC connected to SQL, but I have no clue how to fix it Smile

//Stellan

As far as I'm aware, the most recent officials are running on older code (and older databases) than the latest iOS builds. I ended up upgrading my main HTPC to an unstable (Linux) build so the database version between it and my AppleTV 2 would be in sync.
find quote
urbanracer34 Offline
Junior Member
Posts: 19
Joined: May 2011
Reputation: 2
Location: Canada
Post: #252
I set this up with a Mac OS X server 10.6.8 running on a mac mini with MYSQL and the content held on a Drobo. 2 ATV2s jailbroken and everything (ATV version 4.2.1)

I passworded the shares, for my TV and Movies along with the thumbnail share.

Got mysql library functioning no problem, but no thumbnails for ANYTHING!

What was the problem? I forgot to give XBMC the user/pass for the thumbnails! Did that, wiped the DB, re-ran the library scan, and everything appears to work perfectly!

Just a heads up for anyone with this kind of problem.
find quote
adsharp Offline
Junior Member
Posts: 3
Joined: Jan 2010
Reputation: 0
Post: #253
(2011-02-28 00:57)TheRealDL Wrote:  This is my first post.

I wanted to be able to share my video library across our private network. I purchased two AppleTV2's for just the airplay functionality. I was happy to find a couple of better solutions than Apples iTunes Home Sharing for my 500 Movies and TV Shows. I tried the first one, easy setup, but slow performance. Found out they forked XBMC and bounced away.

Then I bit the bullet and began the journey called XBMC.

I've started a OS X Server with the native MySQL Server running and created the database and advancedsettings.zml outlined in the LifeHacker post. This was pretty good... until I changed the title or artwork of a movie from an AppleTV or MAC OS X Client. POOF. Database gone from view. Run a nightly build? POOF! database gone.

DROP database, CREATE database... I'd say half a dozen times over 2 weeks until I concluded that it was the Apple TV's having WRITE access to xbmc_video!!!!! Oooooo.

Without fanfair, and purely for myself should I ever need it, here is how I'm set up today.

First, The MySQL 'my.cnf' needs a few performance tweeks.


Code:
[client]
socket = /var/mysql/mysql.sock
        
[mysqld]
skip-sync-frm
skip-thread-priority
skip-name-resolve

Second, Need to create the database users. We need a read/write and read only user.

Code:
CREATE USER 'xbmc' IDENTIFIED BY 'yourpassword';
CREATE USER 'xbmcadmin' IDENTIFIED BY 'adminpassword';

...and the databases.

Code:
CREATE database xbmc_video;
CREATE database xbmc_music;

...and grant the rights allowing the Server to write and the Apple TV's read only.

Code:
GRANT ALL ON *.* TO 'xbmcadmin';
GRANT ALL ON *.* TO 'xbmcadmin'@'localhost';
GRANT SELECT ON *.* TO 'xbmc';

Everything is cool at this point EXCEPT my Wife says that she can't stop watching in one room and resume from where she left off in the other room. In other words, a showstopper Smile

So I investigated this a bit and came up with another GRANT...

Code:
GRANT ALL ON [b]xbmc_video.bookmark[/b] TO 'xbmc';

and another for Watched/Unwatched.

Code:
GRANT ALL ON xbmc_video.files to 'xbmc';

I then setup 2 SAMBA sharepoints with guest access on the OS X Server, 'Movies' and 'TV'.

During earlier setups I ran into mongo issues with thumbnails. After resolving that I wanted them outside the /Library, I put them on another drive and setup a SAMBA share point with guest access.

To get XBMC on the server pointed where I wanted it to go, I created a symbolic link in /XBMC to my chosen thumbnail folder.

Code:
ln -s /YourDesiredLocation/thumbnails/ /Users/USERNAME/Library/Application\ Support/XBMC/Thumbnails

Then I setup the advancedsettings.xml on SERVERNAME

Code:
<advancedsettings>

    <videodatabase>
        <type>mysql</type>
        <host>SERVERNAME</host>
        <port>3306</port>
        <user>xbmcadmin</user>
        <pass>ADMINPASSWORD</pass>
        <name>xbmc_video</name>
    </videodatabase>

    <musicdatabase>
        <type>mysql</type>
        <host>SERVERNAME</host>
        <port>3306</port>
        <user>xbmcadmin</user>
        <pass>ADMINPASSWORD</pass>
        <name>xbmc_music</name>
    </musicdatabase>

</advancedsettings>

... And the Apple TV's.

Code:
    <videodatabase>
        <type>mysql</type>
        <host>SERVERNAME</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>YOURPASSWORD</pass>
        <name>xbmc_video</name>
    </videodatabase>

    <musicdatabase>
        <type>mysql</type>
        <host>SERVERNAME</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>YOURPASSWORD</pass>
        <name>xbmc_music</name>
    </musicdatabase>

    <pathsubstitution>
        <substitute>        
            <from>special://thumbnails</from>
            <to>smb://SERVERNAME/xbmc.thumbnails/</to>
        </substitute>
    </pathsubstitution>
  
</advancedsettings>

I then used XBMC on the Server with this Sources.xml

Code:
<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>Movies</name>
            <path pathversion="1">smb://USERNAME:PASSWORD@SERVERNAME/Movies/</path>
        </source>
        <source>
            <name>TV</name>
            <path pathversion="1">smb://USERNAME:PASSWORD@SERVERNAME/TV/</path>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
    </music>
    <pictures>
        <default pathversion="1"></default>
    </pictures>
    <files>
        <default pathversion="1"></default>
    </files>
</sources>

Using XBMC, I added the 'Movie' and 'TV" as Sources and scraped the database. Reviewing and correcting the scraping errors over a day cleaned up the database and I exported from XBMC incase it went POOF again.

I'm glad to say it's ROCKING!!! The Apple TV's have "Movies" and "TV" with all artwork and resumability.

I wanted to say THANK YOU to anyone having to do with this project and kindly answering questions to those that ask.

TheRealDL

For anyone using this setup, (as I have been for the last year or so), Eden changes the name of the databases, requiring permissions to be added for the new database names to effectively use the "watched flag" and "stop position". Essentially, open a query window and execute:
Code:
    GRANT ALL ON xbmc_video57.bookmark TO 'atv2';
    GRANT ALL ON xbmc_video57.files to 'atv2';    
    GRANT ALL ON xbmc_video58.bookmark TO 'atv2';
    GRANT ALL ON xbmc_video58.files to 'atv2';
    GRANT ALL ON xbmc_video60.bookmark TO 'atv2';
    GRANT ALL ON xbmc_video60.files to 'atv2'
or whatever version has been added to your essential libraries.
Big Grin
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,520
Joined: Oct 2003
Reputation: 138
Post: #254
Read the wiki. XBMC need permissions to create databases.

Never, ever, create databases yourself.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
acyclovir Offline
Junior Member
Posts: 1
Joined: Oct 2012
Reputation: 0
Post: #255
Hi, i have made a pathsubstitution, advancedsettings.xml etc.. to share databases between my atv2, and my mac mini, mysql database is located in my synology ds, every thing works perfectly except for: logos, clear arts, same as all artwork downloader´s stuff; there is no skin capable of read any of them, i have given the needed permissions, i am using protected smb, but artwork downloader seems not to like protected smb, is there any one could help me

Thanks in advance (sorry about my poor english)
find quote
Sluuz Offline
Junior Member
Posts: 2
Joined: Feb 2011
Reputation: 0
Post: #256
When is the iOS build going to use the 68 version of the databases (part of Frodo)? My database is currently named MyVideos68 and my ATV (running a nightly build of a few days ago) uses MyVideos60.
(This post was last modified: 2012-10-03 13:45 by Sluuz.)
find quote
Memphiz Offline
Team-XBMC Developer
Posts: 7,665
Joined: Feb 2011
Reputation: 91
Location: germany
Post: #257
then your nightly from a view days ago is not the version you are thinking. We are on db68 for weeks now.

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
find quote
Post Reply