Article: Share Your Library with XBMC using MySQL

Recently, we featured an article on sharing your playstate and watched status with MediaBrowser for WMC.  One of my main reasons for using the software was the shared library features.  Today, with XBMC you are able to perform the same functions.  The process is a bit more difficult, but well worth it.

If you are a user that stores their media on a NAS like QNAP or Thecus then your process will be a bit easier than those of you that don’t.  For XBMC to share this information with other Media Centers in your home, it uses MySQL and because we are such big fans of running a NAS instead of a server, this tutorial will focus the installation towards this.

Thecus:
Start by using the application server to install MySQL.  Luckily for you, Thecus bundles in phpMyAdmin with the auto module installation to allow for easy administration.

QNAP:
Ensure that MySQL is enabled by using the web administration and navigating to Application Servers then to MySQL Server.  Enable MySQL server and leave the port at 3306.  After you have enabled MySQL you can make your life much simpler by installing the QPKG for phpMyAdmin.

Depending on your version of phpMyAdmin, your interface may look a bit different.

1.  From phpMyAdmin select the option to run an SQL Query.

2. Enter the following commands in the new SQL Query window. These commands will create a user named xbmc in your database and apply the privileges needed to allow XBMC to write and modify the databases and records within the databases.

[php]CREATE USER ‘xbmc’ IDENTIFIED BY ‘xbmc’;
GRANT ALL ON *.* TO ‘xbmc’;[/php]

3. Create a file named advancedsettings.xml. This file lets XBMC know where your MySQL database is located, the username and password of the user with privileges to the database, and the names of the databases. You can create the file yourself and save it in the proper location or you can download our template and modify it to your needs. The content of the document should be: (You must replace the IP address of our server below with the IP address of yours)

[php]

mysql
192.168.1.10 3306 xbmc xbmc xbmc_videos


mysql
192.168.1.10 3306 xbmc xbmc xbmc_music


[/php]

Download: advancedsettings.zip

Save the file in: (You need to copy everything in bold if you are going to copy and paste)

  • Windows 7: %appdata%\XBMC\usersdata
  • Windows XP: C:\Documents and Settings\\Application Data\XBMC\userdata\
  • MacOS X: Finder, click the Go menu and select the Go to Folder … option.  Go to the folder, paste the following: ~/Library/Application Support/XBMC/userdata. Click Go
  • Linux: ~/.xbmc/userdata

Note: Your library needs to be configured as such:

smb://name_or_IP_address_of_server/movies. You cannot use an \\ in your library paths.

Now all you need to do is copy your advancedsettings.xml file to the XBMC folder noted above on all of your installations and you are ready to go! Enjoy!

About Joe D

I have always had a passion for everything computing. In early 2000, I decided to take my passion to the web. Thus, C.O.D. was born. Through the years we have made many great friends at C.O.D. and hope to continue our journey for years to come.

Check Also

Best KODI / XBMC Addons for 2015

Last year, we covered some of the addons we felt were the best out there for XBMC. Well, this is a new year and with the new year comes a new list... and name (KODI). This list will NOT include the previously mentioned items in last year's list of top addons. Here is my list for the Best KODI (XBMC) Addons for 2015

8 comments

  1. Thanks

    I have the database up and running now.

    How about synchronizing the thumbails and having them stored on the NAS (I have a Thecus)? I am trying to do this but with little success.

    Thanks for the article.

  2. Hi
    Thanks for the article.
    However@ stage 2 I receive the following error:

    Error

    SQL query:

    CREATE USER ‘xbmc’ IDENTIFIED BY ‘xbmc’;

    MySQL said:

    #1396 – Operation CREATE USER failed for ‘xbmc’@’%’

    any ideas?
    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.