matthuisman/docker-kodi-headless

Unable to open MYSQL database

Manuel5cc opened this issue · 14 comments

I am getting this error everytime, it seems that Kodi can't connect to my database but it shoukld:
ERROR : Unable to open database: MyVideos92 [2013](Lost connection to MySQL server at 'reading initial communication packet', system error: 2)

I have redacted some data for security reasons.

The error tells you what the problem is. Access is denied. You need to fix permissions on your sql server. I'd try remove any IP restriction on the user.

If the problem was the sql server I wouldn't be able to access from my other kodi instances but that is not the case. I think there is something deeper here.

Lost connection to MySQL server at 'reading initial communication packet', system error: 2)

I'll try to investigate further on this

Is this Matrix AMD64? Or arm? Or arm64?

Is this Matrix AMD64? Or arm? Or arm64?

It is Matrix arm (Raspberry Pi 4)

Are you running 64bit or 32bit os?

Googling your error, still seems like your sql server isn't allowing the docker container. Remember that the sql server may see the Dockers internal IP. Not the pis IP. Or it may be the other way around.

Are you running 64bit or 32bit os?

This is all the available information about my OS:

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Looks like it is a 32bit version since 64bit is still in beta.

Ok. Well keep trying. The connection error is usually wrong port or firewall, or IP isn't allowed. Report back when you figure out the issue.

I have tried giving the container a different IP using a macvlan network and the issue dissapears, but I loose access to the webui.

I'd change your sql bind to 0.0.0.0 and make sure the user your using allows any IP. If it's all local network, you don't need to be so restricted. And trying to change a docker container IP is a bad idea. Just let docker handle them. They often change so make your sql setup allows for that by doing the above

I'd change your sql bind to 0.0.0.0 and make sure the user your using allows any IP. If it's all local network, you don't need to be so restricted. And trying to change a docker container IP is a bad idea. Just let docker handle them. They often change so make your sql setup allows for that by doing the above

I finally opted for situating my sql server in a remote location and that seemed to make it work. Not sure if it's ideal but from an enduser perspective it works.

A remote location?
In my setup, I run my sql (mariadb) in a docker container on my local NAS. And headless is also in a container on the same Nas.
https://hub.docker.com/_/mariadb