Changes

From Amahi Wiki
Jump to: navigation, search
4,473 bytes added ,  02:27, 1 February 2019
{{NeedsUpdate}}
<br />
[http://www.amahi.org/apps/xbmc-media-center-retired XBMC Media Center] has been packaged for Amahi (Fedora 14).
 
This was mainly tested on a fairly basic test system, HP a282n, 2gb ram, 40gb hd, nvidia mx-440 8xAGP using the Fedora 12 based, 32bit Amahi express cd.
First we need to create a user and 2 databases which will hold the indexed media (video and music):
Log into the MySQL core using the root account (it will ask you for the password, which is "hda" in Amahi 7){{Code| mysql -uroot -p}}
Create the user "xbmc"
{{Code| CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';}}
Create the databases "xbmc_video" and "xbmc_music"
{{Code| CREATE database xbmc_video; CREATE database xbmc_music;}}
Grant the user "xbmc" access to these databases
{{Code| GRANT ALL ON xbmc_music.* TO 'xbmc'@'localhost' identified by 'xbmc'; GRANT ALL ON xbmc_video.* TO 'xbmc'@'localhost' identified by 'xbmc';}}
Make sure the MySQL knows the changes made
{{Code| flush privileges;}}
Now to have XMBC make use of the MySQL databases:
{{Code|<pre>cat > /home/xbmcuser/.xbmc/userdata/advancedsettings.xml << 'EOF'
<advancedsettings>
<videodatabase>
</musicdatabase>
</advancedsettings>
EOF}}</pre>
Done! Restart XBMC to enable the new settings.
[[image:xbmc-ss.png]]
 
=== Synchronize XBMC library with devices (Raspberry)===
 
First the starting point:
 
I have OpenELEC mainly running on my RPi (version is r13078 from http://openelec.thestateofme.com/) and wanted other devices, e.g. a tablet, to pick up at the same position where I stopped watching on the RPi. Usually XBMC stores this information locally so you could potentially run into a big mess and unsynchronized XBMC installations. So I wanted to get a neat setup where I would not have to worry about which device I now need to use to start at the same part where I left. For this I wanted to use the built-in MySQL server that comes with Amahi and store the media related information there.
 
In order to do so we just need to modify/ create the advancedsettings.xml file in the XBMC installation(s). They all need to be the same though, i.e. a Frodo installation cannot work on the same database as an Eden installation.
 
This is what you need to do:
 
1. SSH into the server or via Terminal and create a MySQL user and database (this will be the user for the XBMC installations)
 
hda-create-user-and-db xbmc
<!--1. SSH into the server or via Terminal and access the MySQL environment in order to create a user (this will be the user for the XBMC installations)
 
Code = mysql -u root -p
}}
 
The standard password used by Amahi is "hda".
 
2. Paste the SQL command to create the user, set permissions, and update everything
{{Code|
Code = CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';
GRANT ALL ON *.* TO 'xbmc'; FLUSH PRIVILEGES;
}}-->
 
2. Now we need to make the adjustments on the OpenELEC installation in order to have OpenELEC connect and use the MySQL database
 
2.1 Open the OpenELEC SMB Share "Userdata" and in it create a file called "advancedsettings.xml" (or edit it if it's already created; DO NOT delete the content already written in it, just add the following code). The following needs to be entered (replace 'x.x.x.x' with the IP of the HDA):
<pre>
Code = <advancedsettings>
<videodatabase>
<type>mysql</type>
<host>x.x.x.x</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
</videodatabase>
<musicdatabase>
<type>mysql</type>
<host>x.x.x.x</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
</musicdatabase>
</advancedsettings>
</pre>
 
2.2 Save the file.
 
2.3 In the same SMB share on your OpenELEC installation please go into the "Database" folder to delete "MyVideosXX.db" & "MyMusicXX.db". XX seem to be random numbers.
 
3. Reboot the Raspberry
 
=== XBMC Gotham MySQL Database===
 
<ins>'''Configure MySQL for XBMC'''</ins>
 
In previous XBMC versions, we manually created the SQL databases for XBMC, with version 12.0 and up, the databases will automatically created by XMBC. The only thing we need to do is create a user account Open phpMyAdmin from the HDA app page (or install it).
 
Click on the 'Add user' link at the 'Users' tab.
 
[http://www.robvanhamersveld.nl/wp-content/uploads/2013/02/phpMyAdmin01.png ''<ins>phpMyAdmin Users</ins>'']
 
Fill in the user details, I'm using username 'xbmc' with password 'xbmc'. Click at 'Global privileges' on 'Check All', by doing this the account is capable to create and alter databases on the MySQL server. In a production setup you probably don't want to do this but in a home network it's fine.
 
[http://www.robvanhamersveld.nl/wp-content/uploads/2013/02/phpMyAdmin02.png ''<ins>phpMyAdmin User Details</ins>'']
 
That's it, your database server is ready to serve XBMC.
 
<ins>'''Connect XBMC to your shared database'''</ins>
 
OK, the database is up, only thing left is to connect XBMC to it. There is no fancy configuration option in the GUI so we have to edit/create a .xml file again. Don't worry, it isn't that hard.
 
The file we need to create (not default present after the installation of XBMC) is advancedsettings.xml and place it into the XBMC userdata folder. In this file we define the MySQL database connection. It should look like this;
 
[http://www.robvanhamersveld.nl/wp-content/uploads/2012/03/advancedsettings.png ''<ins>Advanced Settings</ins>'']
 
You must replace ***.***.***.*** with the IP-address of your MySQL database server.
 
That's all, your centralized library and media files are ready to use.
 
For further information, please visit: http://www.robvanhamersveld.nl/2013/02/05/share-your-xbmc-12-0-library-on-a-synology-ds-or-other-nas/
 
[[Category:Apps]]
12,424

edits