*** Official Kodi (née XBMC) Thread ***

So Ive set up MySQL DB on my NAS from my main HTPC and checked its working by creating a bookmark in a film then finding the file on the db but I cannot get my Pi in the bedroom to work with it.

All ive done is drag the sources and advanced settings files from the main HTPC and stuck them in the Pi. Is this correct?
 
That should be correct.

However, as you have a mixture of Windows and Linux, have you created the sources with the "smb://" prefix (see the very first post in this thread for details as to why)?

How is it "not working"? Do you get any messages?
 
This is my advanced settings

Code:
<advancedsettings>
     <videodatabase>
       <type>mysql</type>
       <host>192.168.178.21</host>
       <port>3306</port>
       <user>XBMC12</user>
       <pass>xbmc12</pass>
       <name>xbmc_video</name>
    </videodatabase>
    <musicdatabase>
       <type>mysql</type>
       <host>192.168.178.21</host>
       <port>3306</port>
       <user>XBMC12</user>
       <pass>xbmc12</pass>
       <name>xbmc_music</name>
    </musicdatabase>
</advancedsettings>

Any my sources.

Code:
sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>NAS TV Shows</name>
            <path pathversion="1">nfs://192.168.178.21/volume1/video/TV Shows/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>NAS Movies</name>
            <path pathversion="1">nfs://192.168.178.21/volume1/video/Movies/</path>
            <allowsharing>true</allowsharing>
        </source>
    </video>
    <music>
        <default pathversion="1">Music</default>
        <source>
            <name>NAS Music</name>
            <path pathversion="1">nfs://192.168.178.21/volume1/music/</path>
            <allowsharing>true</allowsharing>
        </source>
    </music>
</sources>

I thought it was ideal to run nfs on the pi to reduce its workload?

Do I need to delete any old db files the pi may already of set up?

By not working I mean its not syncing up with where i pause or stop a movie or the watched content on my main machine.
 
Code:
<advancedsettings>
    <pathsubstitution>
	    <substitute>
            <from>special://profile/playlists/</from>
            <to>nfs://192.168.1.100/home/mike/xbmc/share/userdata/playlists/</to>
        </substitute>
		<substitute>
            <from>special://profile/addon_data/</from>
            <to>nfs://192.168.1.100/home/mike/xbmc/share/userdata/addon_data/</to>
        </substitute>
		<substitute>
            <from>special://profile/keymaps/</from>
            <to>nfs://192.168.1.100/home/mike/xbmc/share/userdata/keymaps/</to>
        </substitute>
		<substitute>
            <from>special://profile/sources.xml</from>
            <to>nfs://192.168.1.100/home/mike/xbmc/share/userdata/sources.xml</to>
        </substitute>
        <!--<substitute>
            <from>special://profile/mediasources.xml</from>
            <to>nfs://192.168.1.100/home/mike/xbmc/share/userdata/mediasources.xml</to>
        </substitute>-->
		<substitute>
            <from>special://profile/RssFeeds.xml</from>
            <to>nfs://192.168.1.100/home/mike/xbmc/share/userdata/RssFeeds.xml</to>
        </substitute>
		<!--<substitute>
            <from>special://profile/favourites.xml</from>
            <to>nfs://192.168.1.100/home/mike/xbmc/share/userdata/favourites.xml</to>
        </substitute>-->
		<!--<substitute>
            <from>special://profile/passwords.xml</from>
            <to>nfs://192.168.1.100/home/mike/xbmc/share/userdata/passwords.xml</to>
        </substitute>-->
	</pathsubstitution>
    <videolibrary>
          <importwatchedstate>true</importwatchedstate>
     </videolibrary>
    <videodatabase>
        <type>mysql</type>
        <host>192.168.1.100</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </videodatabase> 
    <musicdatabase>
        <type>mysql</type>
        <host>192.168.1.100</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </musicdatabase>
</advancedsettings>

And YES nfs is best for pi.
 
Last edited:
That looks fine - nfs is good for the Pi as it's lower overhead.

What does the contents of your xbmc debug log from the Pi say? (Post it to somewhere like Pastebin then just put the link here)

From that, we can tell whether it's actually read the advancedsettings and connected properly.
 
You've got the following in the debug log, but not too sure of the timestamps.

01:00:17 T:3059089952 ERROR: Unable to open database: xbmc_music46 [2003](Can't connect to MySQL server on '192.168.178.21' (101))


Could you delete the debug log, open XBMC and immediately close it, then paste the logs, so it's simply got the startup and shutdown code?
 
Could this be down to the Pi being connected via wifi when the main htpc is cable?

Its the same for music and video.

01:00:17 T:3059180064 ERROR: Unable to open database: xbmc_video71 [2003](Can't connect to MySQL server on '192.168.178.21' (101))
 
It's possible, if the network isn't available when XBMC starts. I think there's a way of making XBMC wait for the server to be available before starting, but can't remember what...

Delete (or rename) the local MyVideos and MyMusic database files (as you won't be needing them anyway) - if they get recreated (and/or you get an empty library) then you know it's not connected.
 
Oooh, I've just found that you can also redirect your PVR and EPG databases to MySQL, by simply duplicating the format of the video and music databases to the advancedsettings :)

This should prevent me from needing to re-load the EPG database on each client every time.

Code:
<advancedsettings>
    <videodatabase>
        <type>mysql</type>
        <host>192.168.1.1</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </videodatabase>
    <musicdatabase>
        <type>mysql</type>
        <host>192.168.1.1</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </musicdatabase>
    <epgdatabase>
        <type>mysql</type>
        <host>192.168.1.1</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </epgdatabase>
    <tvdatabase>
        <type>mysql</type>
        <host>192.168.1.1</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </tvdatabase>
</advancedsettings>
 
OpenELEC has an option "wait for network" that I had to enable in order to get MySQL working on my bedroom NUC. Whatever flavour of OS/XBMC you are running have a look for something similar.
 
Thanks changed it to wait for network and its working. Soon as it had started the movies I had just added to the NAS via my main HTPC were on the pi ready to go without needing to update library and the stopping on the pi and resuming on main works also.

Thanks for all the help.
 
Excellent, glad you've got it running now :)

Not having to update the library on all the devices was really the main reason for going with MySQL at home (the ability to stop/restart elsewhere is useful, but I've not really used it as much as I should!)
 
Well that was easy.

The longest bit of setting up MySQL was installing MySQL :p.

Is there any way to force a library update without having to run XBMC on a client somewhere?
 
Back
Top Bottom