Kodi Community Forum

Full Version: MySQL Shared Database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I feel like an idiot for having to ask this, but I'm not sure how to set up a shared database using MySQL on Linux. I am running Ubuntu 9.10 (Karmic Koala) and XBMC Dharma Beta 2 (r33778). I have three PCs running this same configuration that I want to share the database for, one of which is the server, which all the media resides on. Each PC has the same username as the default user, so all paths are the same and all media folders are mapped the same. i.e. every PC looks for videos at /home/mediacenter/videos. Currently I am using Dropbox to share the library, which works well, but has it's faults.

I just need a little help in how to get MySQL running. I've searched the forums, but I can't find some of the info I need. Right now I have the install steps as:

Install MySQL
Code:
sudo apt-get install mysql-server

Do some magic....Eek

Change the video/music libraries as such on each PC:
Code:
<videodatabase>
  <type>mysql</type>
  <host>xbmcserver</host>
  <name>xbmc_video</name>
  <user>xbmc</user>
  <pass>xbmc</pass>
</videodatabase>

Code:
<musicdatabase>
  <type>mysql</type>
  <host>xbmcserver</host>
  <name>xbmc_music</name>
  <user>xbmc</user>
  <pass>xbmc</pass>
</musicdatabase>

Then continue using Dropbox to keep the thumbnails in sync, or just use rsync, etc. (I'd rather not just use a share to minimize loading time of thumbnails.)

First, the obvious question of how do I set up the actual database and tables? What is the magic step missing?

Also, will this automatically import my current library into the DB, or will I have to start from scratch?
Thanks!
Once you've installed mysql, open up a terminal and enter
Code:
mysql



Then follow this guide, starting at CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';

Finally, open up /etc/mysql/my.cnf on your server and comment out the bind-address line.

With respect to shared fanart/thumbnails, I just mount them via CIFS (again, located on the server). It feels pretty snappy, but all my machines are wired rather than wireless, and I'm also using DDS fanart.
Thanks! I knew it was easy. :-) The only thing is you do have to export your libraries, then import them again. I finished the main one, I'll set up my other two tonight.

I'll play around with just grabbing the thumbs from the network share, instead of trying to sync them locally. I never tried before, I just figured it would be slow. It also looks like I should be converting them to DDS. Seems to be the way to go. Thanks again!
reverendj1, there is detail on the MySQL install at http://contentwhores.com/media-centers/c...l-library/ and on thumbnail sharing (via symbolic links) at http://contentwhores.com/media-centers/s...t-systems/. Hope this helps.
Thanks for the info. I already got it figured out with fasteddy's link though. I did notice the bit about optimizing the music db at the end of your link (I just kind of skimmed through it). I'll have to do that tonight. It seems like it was written for Windows (i.e. no mention of apt-get, repos, etc). I haven't tested storing the thumbnails on the server yet. Right now I have the folder synced with rsync every 3 minutes. Now that I have used it a few days that way, I will try just storing them on the server to see if I notice a difference.

If I have time this weekend I may post a dummy-proof how-to (or even a script) for setting up a MySQL DB specifically for Linux. It just seems weird that there aren't any on this site, that they are all on some random people's blogs.

Also, for anyone who may have stumbled upon this post, I made a typo for both DBs in advancedsettings.xml. each one should also have this line:
Code:
<port>3306</port>
Thanks for the help!