Kodi Community Forum

Full Version: MSQL Database help! Kodi cannot connect to database if on another local network
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have setup Kodi to work at home using an SQL database which i host on my NAS (Qnap). The NAS is connected to my home network which runs under domain 192.168.1.xx. Now i have two separate WiFi networks running. One uses the same network where the NAS is connected to but has a weaker signal and one is connected to a different network in my house using domain 192.168.0.xx. 

In my advancedsettings.xml file the access to the MySQL database is setup.

  <videodatabase>
    <type>mysql</type>
    <host>192.168.1.xx</host>
    <port>3306</port>
    <user>kodi</user>
    <pass>mypass</pass>
  </videodatabase>

When i connect with my secondary Kodi device (Android platform) to the weaker WiFi network (192.168.1.xx) then Kodi launches without an issue and can access everything.

When i connect to the stronger WifI network (192.168.0.xx) then Kodi won't launch for minutes and also cannot access the videos.
In the log it gives also following error message:

"2020-07-18 14:17:56.741 T:9469   ERROR: Unable to open database: MyVideos116 [2002](Can't connect to MySQL server on '192.168.1.xx' (115))"

In the MySQL database i have following setup for user Kodi:

User account: kodi@%
Global Privilages ticked for everything (Data, Structure, Admin).


Not big on networking setups but if i had to guess the issue is that trying to access the SQL database from outside local network where its hosted on is somehow not working. I don't see any specific setup option in the MySQL database admin page which i could set to allow access from outside local network if thats the issue.

Any help would be appriciated.

Thanks!
What does the my.cnf file on the QNap NAS say about the bind-address?
(2020-07-18, 19:09)Klojum Wrote: [ -> ]What does the my.cnf file on the QNap NAS say about the bind-address?

Good question. Where would i find that file? I simply enabled SQL server in QNAP control pannel then setup the appropriate Kodi account as per the guidelines to work with mysql database. So no idea where i would find that file.
(2020-07-18, 20:26)CaptainHero Wrote: [ -> ]Good question. Where would i find that file?

Perhaps using the backdoor via SSH is an option? The my.cnf file can be in the /etc folder, but I have no idea how QNAP handles the mysql server. Google may be your friend there.
(2020-07-18, 20:48)Klojum Wrote: [ -> ]
(2020-07-18, 20:26)CaptainHero Wrote: [ -> ]Good question. Where would i find that file?

Perhaps using the backdoor via SSH is an option? The my.cnf file can be in the /etc folder, but I have no idea how QNAP handles the mysql server. Google may be your friend there.
Got the file via SSH. Doesn't say anything related to bind-addresses as far as i can tell. Also don't see any note's of my configs in this file (i.e. password, or users setup etc)

my.conf

Maybe as a sidenote. On QNAP to configure MySQL i use phpMyAdmin page so maybe what you are looking for is stored somewhere else?
Hmmm... # The MariaDB server Fascinating.

I don't see it anywhere, but perhaps you can add this somewhere in the [mysqld] section.
Code:
bind-address = 0.0.0.0

And then reboot the database server (or the whole nas).
(2020-07-18, 22:42)Klojum Wrote: [ -> ]Hmmm... # The MariaDB server Fascinating.

I don't see it anywhere, but perhaps you can add this somewhere in the [mysqld] section.
Code:
bind-address = 0.0.0.0

And then reboot the database server (or the whole nas).
Well that didn't work. Added the line, saved and restarted the NAS but it didn't do anything.