Connecting to MySQL from Pi
#1
Al,,

I've MySQL 5.5.35 running on my Windows Box. I use Gotham 13.2 on this box. IP address is hard coded to 192.168.1.99

Seperately I have a PI running OpenElec 4.2.1 (running the same XBMC version) on my PI. IP address is hard coded to 192.168.1.111

The PI could talk to MySQL no problem but now it seems it cannot access the databases - see log here: http://pastebin.com/sShNn5C8

Firewall is set to allow connections 3306 and my router is setup to port forward as well. Connections are all hard wired. I can ping and SSH into the PI from the windows box. I have ensured the user XBMC has permissions within MySQL.

I even wiped the PI memory card and reinstalled OpenElec incase that was an issue. Here's the output from DMESG - http://pastebin.com/k5CsbfWq

Not sure what the next step in the testing process is - any tips appreciated.
Reply
#2
http://kodi.wiki/view/MySQL/Setting_up_MySQL

5.2 Setup users in MySQL for XBMC/Kodi clients

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


^^ Did you do that step to grant access to your mysql database to all IP addresses on your LAN?

---------------------------------------

Are you using an up to date mysql?

Are you sure that the mysql service is running on the host machine?

Are you sure that you never changed the username or password of your mysql database to something other than "xbmc" and "xbmc" (I'm not sure but these might also be case sensitive)?

Are you sure that your PI is connecting to the internet/LAN?


Hope this helps Smile
Reply
#3
(2014-11-19, 21:29)azrael17 Wrote: 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 [/i]

Yes, ran the above commands ... infact, all was working well before this random issue, however, to be on the safe side I removed the user and recreated - still experiencing the same issue.

(2014-11-19, 21:29)azrael17 Wrote: ^^ Did you do that step to grant access to your mysql database to all IP addresses on your LAN?

No, the following command fails to run - GRANT ALL ON *.* TO 'xbmc'@'192.168.1.%'
---------------------------------------
(2014-11-19, 21:29)azrael17 Wrote: Are you using an up to date mysql?

I'm using 5.5 which worked well before

(2014-11-19, 21:29)azrael17 Wrote: Are you sure that the mysql service is running on the host machine?

Yes, windows services shows as running and I can connect to the service/database through MySQL command line client

(2014-11-19, 21:29)azrael17 Wrote: Are you sure that you never changed the username or password of your mysql database to something other than "xbmc" and "xbmc" (I'm not sure but these might also be case sensitive)?

Correct, I have never modified the login credentials.

(2014-11-19, 21:29)azrael17 Wrote: Are you sure that your PI is connecting to the internet/LAN?

Yes, I can ping both boxes from the Lan (Both ways) and I have installed Discovery Network and tested a steam - all worked fine.
Reply
#4
Hmmm.

I'm not sure if this helps but try looking at this post (specifically about bind hosts):

http://forum.kodi.tv/showthread.php?tid=160187

It's directed at linux but there may be a windows equivalent. This might also help for the windows procedure:

http://forums.mysql.com/read.php?11,225993

---------------------------------------------------------------------------------------------------------

Also did you follow and retry the steps here (especially the firewall ones):

http://kodi.wiki/view/HOW-TO:Sync_multip...ab=Windows

---------------------------------------------------------------------------------------------------------

FOR ANYONE ELSE: The offending error is "ERROR: Unable to open database: MyMusic41 [2003](Can't connect to MySQL server on '192.168.1.99' (110))". It repeats for all the different databases. I can't seem to find any direct reference anywhere as to what error 110 refers to, although I think it's a connection timed out thing.
Reply
#5
(2014-11-20, 21:18)azrael17 Wrote: Hmmm.

I'm not sure if this helps but try looking at this post (specifically about bind hosts):

http://forum.kodi.tv/showthread.php?tid=160187

It's directed at linux but there may be a windows equivalent. This might also help for the windows procedure:

http://forums.mysql.com/read.php?11,225993

---------------------------------------------------------------------------------------------------------

Also did you follow and retry the steps here (especially the firewall ones):

http://kodi.wiki/view/HOW-TO:Sync_multip...ab=Windows

---------------------------------------------------------------------------------------------------------

FOR ANYONE ELSE: The offending error is "ERROR: Unable to open database: MyMusic41 [2003](Can't connect to MySQL server on '192.168.1.99' (110))". It repeats for all the different databases. I can't seem to find any direct reference anywhere as to what error 110 refers to, although I think it's a connection timed out thing.

Thanks Azrael,

bind-address isn't a recognised variable in 5.5 it would seem - MySQL refuses to start when I add this into my.ini.

I've redone the MySQL Windows setup and confirmed using a port scanner that the port is open and reachable. I've upped the max connections to 500 but it makes no difference. I may end up reinstalling MySQL.
Reply
#6
Azrael,

A reinstall of MySQL has fixed the problem.

All is good again.
Reply
#7
(2014-11-23, 16:15)ronanmagee Wrote: Azrael,

A reinstall of MySQL has fixed the problem.

All is good again.

Good to hear. =)
Reply

Logout Mark Read Team Forum Stats Members Help
Connecting to MySQL from Pi0