Multiple XBMC Front-ends with MySQL

This is pretty much taken and modified from http://contentwhores.com/media-centers/configuring-xbmc-to-use-a-mysql-library/.

For my scenario, I am using Ubuntu 9.04 Server with MySQL 5.0.75 for the server (and Samba for file shares) and XP Pro 32-bit running XBMC Dharma Beta 4

Webmin Setup
There are many connectors to manage your MySQL server, but I prefer Webmin. If you are going to have your server be headless but still wish to have somewhat of a graphical environment, use Webmin. To install as of 11/18/2010 run this set of commands:wget http://prdownloads.sourceforge.net/webadmin/webmin_1.520_all.deb && sudo dpgk -i webmin_1.520_all.deb && sudo apt-get install -f
Every time I install there are always unmet dependencies that it has to fill, but won't initialize the installation until you run the install -f option.

MySQL Setup
With my server using Ubuntu, I decided to use the MySQL that came with the repositories.
To install, use the command sudo apt-get install mysql
Follow the prompts and tailor the install to your needs (99% of LAN-only uses will just need to set a default password- don't forget this!)

Managing MySQL on Webmin
Log in to your webmin server (https://[host]:10000) and select Servers > MySQL Database Server in the left hand side menu. From here you can create a database, user, and user permissions to that database. You may need to restart the MySQL service after you do.

To create your database and user:

  • Click on Create a new database under the MySQL Databases section and create with a name like xbmc_video and xbmc_music
  • Click the User Permissions icon
  • Click Create a new user with the username xbmc, a password, and host permissions to your local subnet (i.e. 192.168.1.%)
  • Grant all permissions except for create user
  • Click on the Database Permissions
  • Create new database permissions for user xbmc on database xbmc_video from host permissions with all permissions
  • All done with the database and user setup!

Install & Configure XBMC
On your Windows computer you want as your media center front-end, download and install XBMC. At the last page of the install, it will ask if you want to run XBMC. You don't.

Browse to C:\Documents and Settings\[user]\Application Data\userdata\ and create a file in notepad called advancedsettings.xml. In this file, you will need to create some switches that will connect to your MySQL. The text of my file is as follows:

<advancedsettings><videodatabase>
   <type>mysql</type>
   <host>192.168.1.16</host>
   <port>3306</port>
   <user>xbmc</user>
   <pass>xbmc</pass>
   <name>xbmc_video</name>
</videodatabase>

<musicdatabase>
   <type>mysql</type>
   <host>192.168.1.16</host>
   <port>3306</port>
   <user>xbmc</user>
   <pass>xbmc</pass>
   name>xbmc_music</name>
</musicdatabase></advancedsettings>

Share this

Tags: