Pi2 can't access mysql Database

Hi,
i have several PCs and Tablets / Phones in my home and have a NAS (Zyxel 325) that hosts all my video files. The NAS also runs a mysql server with a shared database so i have everything synced on all devices. That works really well and all versions run on the newest Kodi release (16.1).
i’ve recently reactivated my Raspberry Pi 2, plugged a wlan stick in it and did a clean install of OSMC. I copied my advancedsettings.xml from one of my other devices, but the Raspberry Pi 2 can’t seem to access the mysql database.
As a test, i removed the advancedsettings.xml and used a local database which worked without a problem. The Pi can connect to the NAS and can scrape the files anew for a local database. Playback isn’t a problem either.
But i would really like to be able to sync with the rest of my devices, any tipps?

A log can be found here:
http://paste.osmc.io/najifuyumi

ERROR: Unable to open database: MyVideos99 [2003](Can’t connect to MySQL server on ‘192.168.178.32’ (101))

So you will have to do basic network/mysql trouble shooting:

  1. Are the Pi and the NAS on the same network? What is the output of ifconfig and route on OSMC?

  2. Does the xbmc user have access on the mysql database from the IP of OSMC (how did you have him the rights)?

  3. What happens if you do mysql -h 192.168.178.32 -uxbmc -pxbmc

Hello,
Pi and NAS should be in the same network.

I used putty to access my Pi2 and posted the results of ifconfig and route here:
http://paste.osmc.io/gipilitesi.sm

the xbmc user has all rights except GRANT.

i could not run the mysql command you specified (“command not found”) but i have no experience with databases so i’m not sure what i was supposed to do.

install mysql-client first

I tried to do the command by using mySQL Workbench but that didn’t work either. The database on my nas can be managed by phpmyadmin.

Not sure what you mean with that.
You should run it on OSMC. Install the mysql-client package on OSMC and then run the command to check if you can connect.

Hello,
I have installed mysql on the pi now and tried to run the command you specified:[quote=“fzinken, post:2, topic:17698”]
mysql -h 192.168.178.32 -uxbmc -pxbmc
[/quote]
The server seems to accept the connection coming from the Pi2 which leaves me even more baffled than before.
I posted the results here: http://paste.osmc.io/rehesumogo.vhdl

Well it just means you can connect, not that the database is there.

After you login run show databases;

I shows several databases:
information_schema
MyVideo99 <- should be the right one
mysql
osmc <- one i generated when i created a new user some time ago on a different device
phpmyadmin

Then use MyVideo99; and show tables

The tables list shows 34 entries that look correct:
http://paste.osmc.io/poyifunawu.vhdl

Yes, looks right, so I am really not sure where the issue is.
So it still is not working? Can you upload an new debug log?

New Log:
http://paste.osmc.io/ayivufadon

Well sometimes small issue make a difference :slight_smile:

<name>MyVideos99</name>

correct one should be <name>MyVideo</name> (so remove the ‘s’ and don’t have the number in there).

Or rename your database to MyVideos99

Nope, that did not help.

Which of the two suggestions have you done?

Please provide new debug logs.

i tried switching the settings in the advancedsettings.xml :
http://paste.osmc.io/atisihipab

Ok, actually you had misstyped in one of your posts here. Actually your database is correctly named MyVideos99. So either just not add any name tag to your advancedsettings or use <name>MyVideos</name>

While anyhow we are back to step 0 as that was already correct in your first attempt.

I just had an idea - the bootup takes quite a while, probably because of the wlan stick. Could it be that the Pi tries to connect before the network connection is up?

Good idea, did you enable “Wait for Network” in “MyOSMC” -> “Network” -> “Wireless”?