MySQL

From Official Kodi Wiki
Jump to navigation Jump to search

Template:XBMC wiki toc If you have more than one XBMC device on your local network then you might want to synchronize them using a MySQL library. Using a MySQL library allows you to store information about your whole video library in a central database, so that multiple XBMC devices can access the same information at the same time. This gives you the ability to:

  • Share watched and unwatched status for your media on all devices
  • Stop watching a movie or TV show in one room then finish watching it in another room automatically
  • Only one library to maintain for all devices
  • Consolidate thumbnails and fanart to save hard drive space

Share your files

If you haven't already done so, you will need to make your media files accessible to all your XBMC devices by sharing them on the network through file sharing. XBMC itself or the MySQL server will not share the actual files for this set up. Most operating systems have built-in methods for sharing files. Most of XBMC's file sharing protocols will work except for UPnP.


See Category:File Sharing for some of the file sharing methods that work with XBMC.

Setting up the MySQL server

You'll need to choose which of your computers, XBMC devices, or NAS will be the MySQL server. The server needs to be on 24/7 or have wake-on-lan (preferably the former), and needs to have a local static IP. You will probably want the XBMC device that is hosting most or all of your videos and music to also be the MySQL server, but this is not required.

On a computer

Incomplete.png INCOMPLETE:
This page or section is incomplete. Please add information or correct uncertain data which is marked with a ?

MySQL can be installed on just about every major OS:

  1. Install MySQL server
  2. Create a password when asked
  3. Give the database access to your network:
    • Linux: Comment out the following line in the MySQL configuration file (/etc/mysql/my.cnf)
    1. from: bind-address = 127.0.0.1
    2. to  : #bind-address = 127.0.0.1
    • Mac OS X:
    • Windows: Select that you want the database to have network access when prompted during installation.
  4. Get into the MySQL command line interface:
    • Linux: $mysql -u root -p
    • Mac OS X:
    • Windows: Open the "MySQL Command Line Client" from the MySQL start menu
  5. Enter the following commands:
    1. Type in: CREATE USER 'xbmc' IDENTIFIED BY 'xbmc'; and press return
    2. Type in: GRANT ALL ON *.* TO 'xbmc'; and press return
    Editor note: Note these "speed up" commands here -> http://xbmcstuff.bossanova808.net/2011/03/summary-of-xbmc-mysql-database.html?m=1
  6. Close out the command line tool

On a NAS

MySQL can also be installed on some network-attached storage (NAS) device devices. See one of the following guides for more info:

See also