Kodi cannot connect to MySQL/MariaDB on RPi 4 Host

  • I am a 'Newbie' trying to use MariaDB as a database server for Kodi on a RPi 4. I believe that I have set-up all the configuration files correctly, including the MySQL passwords, privileges, Samba shares, and the advancedsettings.xml file.

    I can certainly access the MariaDB server from MySQL Workbench on a Windows desktop computer connected to my local network. For this I use the RPi 4's fixed IP Address as the Host. Directories and their contents can (mostly) be viewed using Windows Explorer. WinSP and PuTTY also function correctly; the latter giving me command-line database-control via MySQL on the Raspberry Pi.

    Unfortunately, the Kodi LIbrary cannot be created on the MariaDB server, as it fails to connect. Repeated Errors, similar to that below, show in the crash log.

    Code
    2019-04-11 17:28:42.867 T:2876646256   ERROR: Unable to open database: MyMusic72 [2002](Can't connect to MySQL server on '192.168.0.16' (101))

    One strange thing about the log is the TIMESTAMP. I don't understand why this particular thread shows the 11th of April 2019. Other threads, not in this particular log, have the correct TIMESTAMP, for example yesterday (2019-11-06). I've only had the RPi 4 for about a month, so the April TIMESTAMP doesn't tie up!

    I would be most grateful if one of the expert team at LibreELEC could possibly skim through the crash log and point me in the right direction to sort out the problem (http://ix.io/2159). I have been going round in circles for several days! ?(

  • Code
    Apr 11 17:28:58 LibreELEC connmand[478]: eth0 {del} route fe80:: gw :: scope 0 <UNIVERSE>
    Apr 11 17:28:58 LibreELEC connmand[478]: eth0 {del} route ff00:: gw :: scope 0 <UNIVERSE>
    Apr 11 17:28:58 LibreELEC connmand[478]: eth0 {add} address 192.168.0.16/24 label eth0 family 2
    Apr 11 17:28:58 LibreELEC connmand[478]: eth0 {add} route 192.168.0.0 gw 0.0.0.0 scope 253 <LINK>
    Apr 11 17:28:58 LibreELEC connmand[478]: eth0 {add} route 192.168.0.1 gw 0.0.0.0 scope 253 <LINK>
    Apr 11 17:28:58 LibreELEC connmand[478]: eth0 {add} route 0.0.0.0 gw 192.168.0.1 scope 0 <UNIVERSE>
    Apr 11 17:28:58 LibreELEC connmand[478]: ntp: adjust (jump): +18133880.539957 sec
    Nov 07 13:40:19 LibreELEC connmand[478]: eth0 {add} route 212.227.81.55 gw 192.168.0.1 scope 0 <UNIVERSE>
    Nov 07 13:40:19 LibreELEC connmand[478]: eth0 {del} route 212.227.81.55 gw 192.168.0.1 scope 0 <UNIVERSE>
    Nov 07 13:40:20 LibreELEC crond[281]: time disparity of 302231 minutes detected

    Pi devices have no RTC chip so on boot before NTP has updated the clock the time will start from the release date of the current version of glibc which probably dates from a release in April. Once the network is up NTP updates the clock and dateTime changes.

    How are you running MariaDB? .. it doesn't look like the DB is up/running before Kodi attempts to access it.

  • Pi devices have no RTC chip so on boot before NTP has updated the clock the time will start from the release date of the current version of glibc which probably dates from a release in April. Once the network is up NTP updates the clock and dateTime changes.

    How are you running MariaDB? .. it doesn't look like the DB is up/running before Kodi attempts to access it.

    I am running MariaDB just as supplied via the LIbreELEC addon. I have now selected 'Wait For Network Before Starting Kodi' from the settings page, but the built-in 10 second delay does not seem to be sufficient.

    When Kodi first boots-up, it states that my Music Library is empty. By entering Add Music>Files, Kodi reboots and the Library becomes available.

    I used sytemctl to check the status of the 'kodi-waitonnetwork.service'. It reported the following message:

    Apr 11 17:28:38 LibreELEC systemd[1]: Starting Wait on network...

    Apr 11 17:28:48 LibreELEC systemd[1]: kodi-waitonnetwork.service: Main process exited, code=exited, status=110/n/a

    Apr 11 17:28:48 LibreELEC systemd[1]: kodi-waitonnetwork.service: Failed with result 'exit-code'.

    Apr 11 17:28:48 LibreELEC systemd[1]: Failed to start Wait on network.

    The TIMESTAMP (as per your comment!) is now explicable. It also shows the appropriate 10 second delay.

    Is there a configuration file somewhere that allows the built-in delay to be increased? Maybe that would help.