MySQL/Setting up Kodi: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
No edit summary
Line 63: Line 63:
==Name tag==
==Name tag==
<section begin="name tag" />
<section begin="name tag" />
An additional <code><name></code> tag can be used for both the video and music entries in advancedsettings.xml if you want to change the name of the database. This is only required if you want to have separate databases on the same MySQL server, like for more than one shared library. The name tag is not required (XBMC will use a default "MyVideos" and "MyMusic" DB name) and it is recommended to not include it, as some users have reported problems/bugs when it was included.
An additional <code><name></code> tag can be used for both the video and music entries in advancedsettings.xml if you want to change the name of the database.
 
The name tag is not required (XBMC will use a default "MyVideos" and "MyMusic" DB name) and it is recommended to not include it if you only need one library, as some users have reported problems/bugs when it was included.
 
The tag is only needed if you want to have separate databases on the same MySQL server, like for more than one shared library. For example, if you want to create multiple profiles, each with their own shared library, so that each XBMC device can "log-into" that library.


{{editor note|eventually we'll have a better section for explaining the <name> tag. Until then, check out the alternative MySQL guide from howtogeek.com, which does dive into using the <name> tag for multiple databases and even profiles: [http://www.howtogeek.com/75535/how-to-sync-your-media-across-your-entire-house-with-xbmc/ How to Sync Your Media Across Your Entire House with XBMC].}}<section end="name tag" />
{{editor note|eventually we'll have a better section for explaining the <name> tag. Until then, check out the alternative MySQL guide from howtogeek.com, which does dive into using the <name> tag for multiple databases and even profiles: [http://www.howtogeek.com/75535/how-to-sync-your-media-across-your-entire-house-with-xbmc/ How to Sync Your Media Across Your Entire House with XBMC].}}<section end="name tag" />

Revision as of 23:54, 4 July 2012

HOW-TO:Sync multiple libraries/Contents Each device that will be sharing a library will need an advancedsetting.xml file.


Steps

advancedsettings.xml:
<advancedsettings>
    <videodatabase>
        <type>mysql</type>
        <host>***.***.***.***</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </videodatabase> 

    <musicdatabase>
        <type>mysql</type>
        <host>***.***.***.***</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </musicdatabase>
</advancedsettings>

See also this note about using the <name> tag: #Name tag

  1. Open XBMC on the computer that has the library you want to share (If you have not created a library yet you can skip this step)
    1. Export the Video Library by doing the following:
      1. Go to System/Settings -> Video -> Library and select Export library
      2. Select Single file
    2. Export the Music Library by doing the following:
      1. Go to System/Settings -> Music -> Library and select Export library
      2. Select Single file
  2. Create (or add to, if you already have one) an advancedsettings.xml file:
    1. Open up a plain text editor
    2. Copy and paste the text from the right-hand box into a new text document
    3. Replace the two instances of ***.***.***.*** with local network IP address of your MySQL server
    4. Save the file as advancedsettings.xml
  3. Copy this advancedsettings.xml file you just created to the userdata folder of every XBMC install you want to sync with:
    • Windows XP: Documents and Settings\<your_user_name>\Application Data\XBMC\userdata\advancedsettings.xml
    • Vista/Windows 7: Users\<your_user_name>\AppData\Roaming\XBMC\userdata\advancedsettings.xml
    • Mac OS X: /Users/<your_user_name>/Library/Application Support/XBMC/userdata/advancedsettings.xml
    • iOS: /private/var/mobile/Library/Preferences/XBMC/userdata/advancedsettings.xml
    • Linux: $HOME/.xbmc/userdata/advancedsettings.xml
  4. Open any of your XBMC installs and re-import your library data (If you have not created a library yet you can skip this step)
    1. Import the Video Library by doing the following:
      1. Go to System/Settings -> Video -> Library and select Import library
      2. Select the file you saved from the first step when you exported your video library
    2. Import the Music Library by doing the following:
      1. Go to System/Settings -> Music -> Library and select Import library
      2. Select the file you saved from the first step when you exported your music library
  5. You can now add files and update the library from any of your XBMC devices and the library for all of them will stay in sync.


  • NOTE: If you want to update the library from any of the XBMC devices then they must all have the same sources set. See the Sources section of Part 6 for one method of keeping them in sync.
  • NOTE: If you encounter error 1062, then you'll need to change your paths from "\\" to "//" as MySQL has trouble understanding "\\"
  • NOTE: If you are using Eden, the video MySQL database will have 60 appended to the name (ex. video_database60). The music MySQL database will have 18 appended to the name (ex. music_database18).

Name tag

An additional <name> tag can be used for both the video and music entries in advancedsettings.xml if you want to change the name of the database.

The name tag is not required (XBMC will use a default "MyVideos" and "MyMusic" DB name) and it is recommended to not include it if you only need one library, as some users have reported problems/bugs when it was included.

The tag is only needed if you want to have separate databases on the same MySQL server, like for more than one shared library. For example, if you want to create multiple profiles, each with their own shared library, so that each XBMC device can "log-into" that library.

Editor note: eventually we'll have a better section for explaining the <name> tag. Until then, check out the alternative MySQL guide from howtogeek.com, which does dive into using the <name> tag for multiple databases and even profiles: How to Sync Your Media Across Your Entire House with XBMC.