Setting up the Library mode that will store information about our content
Sharing this across multiple machines with a MySQL database
Setting up Raspbmc to use this database
Note
If you are planning to use a MySQL database to share the library across multiple devices, you should read the section on installing and configuring a MySQL database first.
Installing MySQL
It's best to install MySQL on the same system we'll be serving files from. This makes sense as we'll need both the file server and the database server to be online to play content, so we may as well confine these services to one system.
Installing on Linux
The MySQL package can be fetched via your distribution's default repositories, as follows:
First, we need to fetch the packages using our distribution's package manager as follows:
On Debian/Linux Mint or Ubuntu systems, we can do this with the following command:
sudo apt-get install mysql-server
On Redhat, CentOS, and Fedora systems, we can do this with the following command:
sudo yum install mysql-server
Now, we need to allow remote access to the MySQL database service. We can do that with the following command:
sed -i /etc/mysql/my.cnf -e 's/bind-address/#bind-address/'
We now need to restart the MySQL service, which can be done with the following command:
sudo service mysql restart
Installing on Mac OS X
The MySQL package must be obtained from the MySQL website in OS X. The following steps will help you install MySQL on Mac OS X:
Open the DMG folder and run the mysql-5.*.*.pkg file. This will launch the MySQL installer.
Perform a standard installation of the MySQL package.
We will want our MySQL server to launch on startup. Go back to the contents of the DMG folder and run MySQLStartupItem.pkg.
Perform a standard installation of the MySQLStartupItem package.
Return to the contents of the DMG folder again and launch MySQL.prefPane. You will be prompted to install a preferences pane for MySQL. Install this for all users of the computer.
Open MySQL preferences. Start the MySQL server and check the checkbox entitled Automatically start MySQL Server on startup.
Open Terminal and enter touch .bashrc. Using your favorite text editor, add the following command to this file:
export set MYSQL_HOME=/usr/local/mysql-5.5.18-osx10.6-x86_64
export set PATH=$PATH:$MYSQL_HOME/bin
Note
You should substitute the version number in the preceding example for the actual version you have installed. You can verify this with the following command:
ls /usr/local| grep mysql
Lastly, we need to allow remote access with the following command:
sed -i /etc/mysql/my.cnf -e 's/bind-address/#bind-address/'
You should log off and log in again so that the new MySQL variables defined in .bashrc are exported.
Installing on Windows
The MySQL package for Windows can be fetched from the MySQL website. The following steps will help you install MySQL on Windows: