XBMC can't connect to MySQL for only 1 NUC client
#1
I am new to XBMC but so far very happy except for one nagging issue I can't figure out.

I setup MySQL to sync my library. Currently I have 2 windows clients and 2 OpenELEC clients running on Intel NUCs. One NUC works great, the other one doesn't. Windows machines are fine. I am using the same advancedsettings.xml and sources.xml files across all 4 clients. On one of the NUCs I have never seen an issue connecting to MySQL. On the one I just got today, it has connected to MySQL maybe 2-3 times out of 50 reboots and 3-4 reinstalls. I am using version OpenELEC-Intel.x86_64-2.99.2.

This is what I see in the log:
<SNIP>
01:01:44 T:139762704336704 NOTICE: Running database version Addons15
01:01:44 T:139762704336704 DEBUG: Initialize, updating databases...
01:01:44 T:139762704336704 NOTICE: Running database version ViewModes4
01:01:44 T:139762704336704 NOTICE: Running database version Textures13
01:01:44 T:139762704336704 ERROR: Unable to open database: MyMusic32 [2003](Can't connect to MySQL server on '192.168.1.99' (101))
<SNIP>
01:01:44 T:139762704336704 ERROR: Unable to open database: MyVideos75 [2003](Can't connect to MySQL server on '192.168.1.99' (101))
<SNIP>

I am using DHCP on both. When I get the above error, I don't see the Movies or TV options on the menu. I can go to files, select a source, browse and playback content just fine. My media files are stored on an unRAID server, which is also the same machine that is hosting the MySQL database. The only difference between the two NUCs is one has a 32GB SSD and the other is 64GB. I would have ordered exactly the same, but that's what was in stock. The one that is having a problem has the 32GB card installed. Both are Crucial M4.

Any ideas?

I saw this thread that looks like a similar issue, and suggesting adding a delay to startup. How do you do that?
http://forum.xbmc.org/showthread.php?tid...id=1319748
Reply
#2
Started watching the MySQL log, and I see nothing at all in the log when I boot and get the above error. I see lots of stuff when a client connects normally.

I swapped my NUCs between locations, and neither of them worked. Swapped them back and I am back to my problem in my original post, one works fine. Tried rebooting my router that didn't make a difference. More confused I am.
Reply
#3
Hi jimmyjoe

Seems that your question is not solved yet. I'm having same problem, mysql 5.6 setup with shared libraries, XBMC 12.0 from windows 8 work perfectly, my media center (HP TC) with OpenElec 2.99.3 cannnot connect with mysql, advancedsettings.xml file is the same. XBMC.log in OE shows same error as you:

"Can't connect to MySQL server on '192.168.1.100' (101)"

I found a solution in this topic http://openelec.tv/forum/69-network/3246...after-boot that's working for me. Seems that OE launch MySQL connection before initialize network at boot, so database cannnot be reached. You have to create the file /storage/.config/autostart.sh in OE and add "sleep 25" inside, after reboot it worked perfectly.
Reply
#4
Thanks for the response! I should have posted back here but I did find a solution, it's similar using autostart to bring up eth0 but no sleep, so no delay.

As long as you are using a static IP, you can put something like this in your autostart.sh file:
Code:
#!/bin/sh
ifconfig eth0 up
ifconfig eth0 192.168.1.5
route add default gw 192.168.1.1

http://openelec.tv/forum/112-mysql-setup...ient#63933
Reply
#5
Truly it's better option, but I realized that in OE 2.99.4 there's an option under System -> OpenElec -> System -> "Wait for network before starting xbmc" that works like a charm, so problem it's definitely solved for me, thank you all for the support Smile
Reply
#6
Any idea how to make a work around that ? I have a custom ubuntu with xbmc launched by lightdm at boot ...

Currently I have to restart lightdm after a reboot for xbmc to catch mediadb from mysql.

(edit : first time that having an SSD and booting faster is causing me troubles Big Grin)
Reply
#7
Similar to waiting for udev you can probably also wait for network.

http://wiki.xbmc.org/index.php?title=XBM...io_devices

http://askubuntu.com/questions/69008/how...mpleting-b
Reply
#8
(2013-02-26, 01:37)jimmyjoe Wrote: Thanks for the response! I should have posted back here but I did find a solution, it's similar using autostart to bring up eth0 but no sleep, so no delay.

As long as you are using a static IP, you can put something like this in your autostart.sh file:
Code:
#!/bin/sh
ifconfig eth0 up
ifconfig eth0 192.168.1.5
route add default gw 192.168.1.1

http://openelec.tv/forum/112-mysql-setup...ient#63933
Just had a similar/same problem.

Mine was a little odd... just got a Pi 2 & I am running OpenELEC 6.0.0 which has been working fine for the past few days using my sources.xml & advancedsettings.xml. Anyway the video seemed to freeze after pausing a movie so I rebooted it then it could no longer connect to the MySQL DB on my Synology NAS. Tested 2 Win 10 PCs and they still worked fine. Tried a few things before I found this thread with no luck.

Created and edited the autostart.sh and all is ok now. I was previously using DHCP

ssh: /storage/.config/autostart.sh
Windows: \\192.168.1.7\Configfiles\autostart.sh

Cheers
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC can't connect to MySQL for only 1 NUC client0