Forum

Full Version: library sharing using mysql-server on XBian
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Software
XBian version: XBian 1.0 (knockout) (kernel: Linux 4.1.6+)
XBMC/Kodi version: Kodi 15.2-RC2 Git: 2015-09-22
Overclock settings: default

Hardware
Device type: Raspberry Pi 2 Model 1GB RAM, CuBox-i i4Pro, ...):
Power supply rating: 2amp
SD card size and make/type: 8GB unbranded
Network (Ethernet or wireless): wired
Connected devices (TV, USB, network storage, ...):
TV (SAMSUNG 32")
ONKYO TSX 607 AMP

Log files
Link to logfile(s):
Kodi Log http://pastebin.com/embed_js.php?i=v6J2Tg58

Problem description:
Hello All

I am really, really struggling with setting up mysql on my raspberry Pi using XBian. I have done this successfully several times before using the guide on the kodi wiki page and kodibuntu. It has normally worked without error. This time round I just cannot get the sql database to populate. On checking the kodi log I can see that kodi can't connect to the sql server. But I lack the knowledge to work out why or how to track the reason behind the error.

My advancedsettings.xml content is shown in the log on line 83 - 102
The error "ERROR: Unable to open database: MyMusic52 [2003](Can\'t connect to MySQL server on \'192.168.0.5\' (111))" is on line 199
...

I have tried various things to resolve the problem:
1: tried different bind addresses in the .cnf file, tried 127.0.0.1 and the server address of 192.168.0.5
2: http://forum.kodi.tv/showthread.php?tid=160187
3: http://forum.kodi.tv/showthread.php?tid=114345
4: I have installed phpmyadmin and can access the mysql data from there, the KodiUser appears to be setup correctly. I have tried changing the privileges of this user to 'all' but no change.

How to reproduce:
Install Xbian on an 8GB MicroSD card using XBian Installer on OSX 10.10.4
SSH in, then use XBian dashboard to apt-get update and apt-get upgrade all
Exit to shell and sudo apt-get install mysql-server
sudo service mysql stop
edit /etc/mysql/my.cnf and set bind address to 0.0.0.0
sudo service mysql start
mysql -u root -p
CREATE USER 'KodiUser' IDENTIFIED BY 'KodiPassword';
GRANT ALL ON *.* TO 'KodiUser';
flush privileges;
quit
sudo shutdown -r now
once rebooted, add the music source to the library and try to scan source to the library
scanning will begin but the 'library mode' option stays grayed out. No music populates
Well just thought I'd put a note here to say that I found a solution to this problem with the help of the kodi forum. Please see the guidance below.

Quote:
(29th Sep, 2015 04:09 PM)littlejeem Wrote: [ -> ]
(29th Sep, 2015 08:49 AM)menakite Wrote: [ -> ]Ah, wait, I remember a problem on XBian in case of a local MySQL server.

Can you try editing /etc/default/xbmc and change the line:
Code:
WAITFOR=""

to:
Code:
WAITFOR="mysqld"

thanks menakite, I will try to when I get home tonight and report back.

littlejeem

Hello Menakite

I just wanted to let you know that I did:
Code:
nano /etc/default/xbmc

Couldn't save the code as got permission denied when saving changes so tried:
Code:
sudo nano /etc/default/xbmc
That worked so restarted the raspberry pi.

Tried rescanning the media source to the library and it bloomin worked first time!!

Thanks a bunch, will remember this tip

Littlejeem
Reference URL's