Select that you want the database to have network access when prompted during installation.
Open the "MySQL Command Line Client" from the MySQL start menu
Enter the following commands:
Type in: CREATE USER 'xbmc' IDENTIFIED BY 'xbmc'; and press return
Type in: GRANT ALL ON *.* TO 'xbmc'; and press return
Close out the command line tool
If you're using a firewall such as the one that's built into Windows, you will need to do this next step.
Windows 7 Built-in Firewall
Go to control panel and open Windows Firewall
Click on Advanced Settings
Click on Inbound Rules, then New Rule
For the Rule Type, choose Port and hit Next
For Protocol and Ports, select TCP protocol and type in 3306 for the Specific local ports and hit Next
For Action, leave it at default which is Allow the connection and hit Next
For Profile, you can leave it as default (everything checked by default) and hit Next
For Name, set it to MySQL or any name that you will know what it is and click Finished
Windows XP Built-in Firewall
Open Control Panel and Set to 'Classic View'
Double Click on Windows Firewall
Click on tab that says Exceptions
Click on Add Port
Name it MySQL or any other name
Set the port number to 3306
Choose TCP and click OK
Note: If XBMC is unable to connect to the MySQL server, it will return an error code :
If this occurs to you, try amending Step 2 above to read GRANT ALL ON *.* TO 'xbmc'@'xxx.xxx.xxx.%'; where xxx.xxx.xxx is the first three quadrants of your home network's IP address (192.168.1 for example) and % as the last quadrant to allow addresses on the same subnet to connect.
Optional: For a more secure MySQL installation use these 2 commands to grant permission only to databases XBMC uses. This is useful if you plan on using your MySQL server for more than just XBMC, or if you're worried about your internal network being exposed and wanting to lock things down more, etc. If you only use the MySQL server for XBMC and that server has non-critical data on it, then this probably not necessary.
GRANT ALL ON `MyMusic%`.* TO 'xbmc'@'%' IDENTIFIED BY 'xbmc';
GRANT ALL ON `MyVideos%`.* TO 'xbmc'@'%' IDENTIFIED BY 'xbmc';
Note: these grants do not appear to give the xbmc user permissions to create required TRIGGERs. So either figure out how to do an additional limited grant to create TRIGGERs or use the broader grant *.* statement above.
Share libraries using MySQL/Setting up XBMC
1. Make files accessible over the network
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 to the network, or a NAS device can be used.
If you use passwords on your network shares then you will need to copy (or sync) your passwords.xml file from the userdata folder to each XBMC device.
Do not use mapped drives on the OS-level, as XBMC will see those as local drives.
If you use smb:// paths, you may want to use static IP addresses rather than NetBIOS names, as not all your devices may be able to resolve the later.
Even if the media is on the same computer as one of the XBMC instances, you MUST use a network share path. You cannot use a local file path with MySQL.
Copy and paste the text from the right-hand box into a new text document
Replace the two instances of ***.***.***.*** with local network IP address of your MySQL server. If you installed MySQL on a Windows machine, do not use its NetBIOS name, as not all devices may be able to resolve them.
Save the file as advancedsettings.xml
Copy this advancedsettings.xml file you just created to the userdata folder of every XBMC install you want to sync with.
Open any of your XBMC installs and re-import your library data, or simply set up a new library if you are starting fresh.
Add (or just "set content" on) the networked video source to XBMC and scan it in as if you were setting up your library for the first time (see adding videos to the library). However, XBMC will read the exported nfo files and images and use those instead of rebuilding the library from scratch. The end result will be an identical library, and your watched status for videos will be preserved.
Note: You must add a network source using XBMC's standard formatting. For example, use "smb://192.168.1.20/Videos/" and not "\\BOBPC\Videos\". Try to use static IP addresses over NetBIOS names if using SMB.
Import the Music Library by doing the following: Same idea as videos, but using the steps for adding music to the library. You'll end up with an identical library.
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.
5. 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.