Solved library sharing using mysql-server on XBian
#1
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 'kodi';
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
Reply
#2
(2015-09-28, 22:47)littlejeem Wrote: CREATE USER 'KodiUser' IDENTIFIED BY 'KodiPassword';
GRANT ALL ON *.* TO 'kodi';

Maybe that's your problem, right there. You've created a user "KodiUser", then granted privileges to a different user "kodi".
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#3
(2015-09-28, 23:17)Milhouse Wrote:
(2015-09-28, 22:47)littlejeem Wrote: CREATE USER 'KodiUser' IDENTIFIED BY 'KodiPassword';
GRANT ALL ON *.* TO 'kodi';

Maybe that's your problem, right there. You've created a user "KodiUser", then granted privileges to a different user "kodi".

Hi Millhouse.

Thanks for the speedy reply. I will check, I'm pretty sure that's a typo on my part....but as I wrote this from my own 'how to guide' to myself I'd better check!

Littlejeem
Reply
#4
(2015-09-28, 23:26)littlejeem Wrote:
(2015-09-28, 23:17)Milhouse Wrote:
(2015-09-28, 22:47)littlejeem Wrote: CREATE USER 'KodiUser' IDENTIFIED BY 'KodiPassword';
GRANT ALL ON *.* TO 'kodi';

Maybe that's your problem, right there. You've created a user "KodiUser", then granted privileges to a different user "kodi".

Hi Millhouse.

Thanks for the speedy reply. I will check, I'm pretty sure that's a typo on my part....but as I wrote this from my own 'how to guide' to myself I'd better check!

Littlejeem

I did check and it was a typo I had in fact entered

Code:
GRANT ALL ON *.* TO 'KodiUser';

Littlejeem
Reply
#5
So your MySQL server runs on the Pi?
111 is connection refused. Have you tried 127.0.0.1 (localhost)?
Reply
#6
I'm not sure why you felt it necessary to change the username - users that go 'off piste' when configuring MySQL usually come a cropper because they've changed something or skipped a step they didn't understand.

Anyway... is MySQL still running on 192.168.0.5? Does the MySQL server have a fixed or dynamic IP address?

Try:
Code:
mysql -u KodiUser -p -h 192.168.0.5
and enter "KodiPassword" as the password - do you connect or is there an error?
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#7
(2015-09-28, 23:39)menakite Wrote: So your MySQL server runs on the Pi?
111 is connection refused. Have you tried 127.0.0.1 (localhost)?

Hello Menakite

Thanks for the response and for the tip on the '111' code. When you say 127.0.0.1, do you mean in the mysql .conf file?

If so yes I have.

Littlejeem
Reply
#8
(2015-09-28, 23:45)Milhouse Wrote: I'm not sure why you felt it necessary to change the username - users that go 'off piste' when configuring MySQL usually come a cropper because they've changed something or skipped a step they didn't understand.

Anyway... is MySQL still running on 192.168.0.5? Does the MySQL server have a fixed or dynamic IP address?

Try:
Code:
mysql -u KodiUser -p -h 192.168.0.5
and enter "KodiPassword" as the password - do you connect or is there an error?

Hello Milhouse

Thanks again for the help. I used KodiUser and KodiPassword as I'd found them in a guide and thought they'd help me differentiate between the two when setting up the system. I'm mode than happy to set up a user more traditionally and alter the advancedsettings.XML to match if better?

Yes mysql-server is running on 192.168.0.5

Using your command and entering KodiPassword logs me into mysql prompt.

Code:
xbian@xbian ~ $ mysql -u KodiUser -p -h 192.168.0.5
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 38
Server version: 5.5.44-0+deb8u1 (Debian)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Littlejeem
Reply
#9
(2015-09-29, 00:10)littlejeem Wrote: Hello Milhouse

Thanks again for the help. I used KodiUser and KodiPassword as I'd found them in a guide and thought they'd help me differentiate between the two when setting up the system. I'm mode than happy to set up a user more traditionally and alter the advancedsettings.XML to match if better?

Most guides either use "xbmc" or "kodi" as the username (depending on the age of the guide), and the same again for the password. It's just that when I see someone using a "non-standard" username (and I admit I haven't read all the guides that are out there) then it makes me wonder what else might have been changed...

(2015-09-29, 00:10)littlejeem Wrote: Yes mysql-server is running on 192.168.0.5

Using your command and entering KodiPassword logs me into mysql prompt.

In that case I can't imagine what the problem is right now...
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#10
(2015-09-29, 00:17)Milhouse Wrote:
(2015-09-29, 00:10)littlejeem Wrote: Hello Milhouse

Thanks again for the help. I used KodiUser and KodiPassword as I'd found them in a guide and thought they'd help me differentiate between the two when setting up the system. I'm mode than happy to set up a user more traditionally and alter the advancedsettings.XML to match if better?

Most guides either use "xbmc" or "kodi" as the username (depending on the age of the guide), and the same again for the password. It's just that when I see someone using a "non-standard" username (and I admit I haven't read all the guides that are out there) then it makes me wonder what else might have been changed...

(2015-09-29, 00:10)littlejeem Wrote: Yes mysql-server is running on 192.168.0.5

Using your command and entering KodiPassword logs me into mysql prompt.

In that case I can't imagine what the problem is right now...

Thanks again for trying I'll start again and use standard username and password combo. Will post back results.

Littlejeem
Reply
#11
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"
Reply
#12
(2015-09-29, 00:49)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
Reply
#13
(2015-09-29, 08:09)littlejeem Wrote:
(2015-09-29, 00:49)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
Reply

Logout Mark Read Team Forum Stats Members Help
library sharing using mysql-server on XBian0