Featured Post

HOW TO: Install VPN server on Ubuntu when server is behind firewall

The whole point in this post is to run your own VPN service, and allow you to connect remote devices to your home network. To start off yo...

Dec 4, 2015

HOWTO: Configuring Kodi to use NAS4Free MySQL DB for central library

If you haven't already installed and setup MySQL on your NAS4Free box, I suggest you follow this guide:
http://www.geekfreely.com/2015/12/howto-mysql-install-guide-for-nas4free.html

We start off by making a for Kodi to access the DB. First we need to login to the MySQL environment to define the user:

mysql -u root -p

Note: If MySQL isn't started then

Enter the password for  root and then create the Kodi user, here I call them xbmc for nostalgia:

CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';
GRANT ALL ON *.* TO 'xbmc';
quit;

Create (or add to, if you already have one) an advancedsettings.xml file in your Kodi userdata folder.
Using nano copy and paste the following information into the advancedsettings.xml file, if there is already content, merge the sections appropriately:

advancedsettings.xml configuration found in the following location:
http://kodi.wiki/view/HOW-TO:Share_libraries_using_MySQL/Setting_up_XBMC

And should look like this:

<advancedsettings>
    <videodatabase>
        <type>mysql</type>
        <host>***.***.***.***</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </videodatabase>

    <musicdatabase>
        <type>mysql</type>
        <host>***.***.***.***</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </musicdatabase>

     <videolibrary>
          <importwatchedstate>true</importwatchedstate>
     </videolibrary>
</advancedsettings>

Replace the two instances of ***.***.***.*** with local network IP address of your NAS4Free server. It is recommended not to use its NetBIOS name, as not all devices may be able to resolve them.

Save the file as advancedsettings.xml.  Copy this advancedsettings.xml file you just created to the userdata folder of every Kodi install you want to sync .

If you exported your existing DBs, go ahead and import them.  If you created a fresh DB, scan all your content again, make sure to use the NAS4Free server IP rather than NetBIOS for your shares, as mentioned - not all devices may resolve the NetBIOS.

As a final note, specifically with OpenELEC and Raspberry Pi, although OpenELEC suggest this for WiFi boxes, set Wait for network before starting Kodi under OpenELEC addon settings, network.
That is it...you should be good to go.  Let me know how it goes for you, or if you have any issues.

No comments: