Shared Library and MySQL does not work on LibreELEC (Krypton) v7.90.008

  • Hi.
    I'm trying to have a "central" video library using MySQL, so all my Kodi devices will have the same and synchronized library.
    I followed this guide: MySQL - Official Kodi Wiki
    It's an easy setup but I was not able to get working.
    When my LibreELEC (Krypton) v7.90.008 ALPHA on Odroid C2 starts is not able to access to MySQL server (or this is the error) and it's not able to create the new Database (or this is the error).
    See here the errors on LibreELEC side:


    This is my advancedsettings.xml on LibreELEC:


    On MySQL Server side I have:


    - Raspberry Pi 2 running MySQL version 5.5.52 (Linux raspberrypi 4.4.32-v7+ #925 SMP Wed Nov 16 21:39:23 GMT 2016 armv7l GNU/Linux)
    - MySQL listening IP "bind-address" setted to 0.0.0.0 (it means all IPs)
    - The port 3306 is opened and working
    - No firewall
    - I use others applications that use (connect, query, insert, etc..) other databases/instances on the same MySQL Server
    - MySQL listen correctly on 0.0.0.0 port 3306, see here:

    Code
    1. [email protected]:~# netstat -a | grep -i sql
    2. tcp        0      0 *:mysql                 *:*                     LISTEN
    3. tcp        0      0 localhost:mysql         localhost:50170         ESTABLISHED
    4. tcp        0      0 localhost:50170         localhost:mysql         ESTABLISHED
    5. unix  2      [ ACC ]     STREAM     LISTENING     7159     /var/run/mysqld/mysqld.sock
    6. unix  3      [ ]         STREAM     CONNECTED     7775     /var/run/mysqld/mysqld.sock


    I was able to connect to MySQL over network:


    MySQL "kodi" user grants are OK:

    Code
    1. mysql> SHOW GRANTS FOR 'kodi';
    2. +--------------------------------------------------------------------------------------------------------------+
    3. | Grants for [email protected]%                                                                                            |
    4. +--------------------------------------------------------------------------------------------------------------+
    5. | GRANT ALL PRIVILEGES ON *.* TO 'kodi'@'%' IDENTIFIED BY PASSWORD '*2249595D6A53B38A77AA4AB2091D9B1A71F88735' |
    6. +--------------------------------------------------------------------------------------------------------------+
    7. 1 row in set (0.00 sec)


    Then on MySQL side is all OK.


    The problem seem that LibreELEC does NOT connect to the database, I mean no MySQL ethernet traffic over the LAN from LibreELEC to MySQL Server....
    See there a "tcpdump" executed on MySQL Server (192.168.147.6) when LibreELEC boot:


    As you can see LibreELEC (IP 192.168.147.27) does NOT try to connect to MySQL Server (tcpdump shows only netbios requests), there are NOT any requests/connections to MySQL (port 3306).
    FYI, If I execute a "crude" telnet to MySQL Server on port 3306 from LibreELEC I can access to that port....


    Any ideas?
    Thanks!

    [hr]
    Running Kodi 17 thanks to LibreELEC on Odroid C2 and on Raspberry Pi 2

    Edited once, last by outcave ().

  • There's a MySQL client in LE, can you connect to the MySQL server from the LE command line?
    [hr]
    Also, please post a complete debug log (and use a pastebin site, don't post logs to the forum).

    Edited once, last by milhouse ().


  • There's a MySQL client in LE, can you connect to the MySQL server from the LE command line?


    If you mean "mysql", I can answer NO: "mysql" command is "not found"
    sqlite3 is the only one command available that starts with "sql"


    I wll post via pastebin a full DEBUG log, but trust me, no others info on it about MySQL.

    [hr]
    Running Kodi 17 thanks to LibreELEC on Odroid C2 and on Raspberry Pi 2

    Edited once, last by outcave ().

  • Crap, thought we had a MySQL client - think I've mis-remembered and it was the sqlite3 client we added a while back.

  • indeed, if "mysql" command is not in LibreELEC I think is quite normal that LibreELEC cannot connect to a MySQL Server.... :D
    Will it be added soon (asap)?

    [hr]
    Running Kodi 17 thanks to LibreELEC on Odroid C2 and on Raspberry Pi 2

  • Huh? No, Kodi doesn't need the command line client - it uses a library. I only suggested the client to try and narrow down the issue. MySQL access is working fine in LE, it's in use by many other users. The problem here is almost certainly a server configuration error, no network at startup, or some other network issue. As requested, post a link to a full debug log.

  • Here the DEBUG log: NaUn8TWr



    I have the feeling that some Kodi stuff starts, in LibreELEC, before the network goes UP, see for example the row 738 and some next. The "LibreELEC Addon" fails due to a "Temporary failure in name resolution". But from the shell I can correctly resolve releases.libreelec.tv
    Also the MySQL connection is even before at row 481.. so how is it possible that it can connect to MySQL Server at that time (18:52:42) if later (at 18:52:44) cannot resolve an hostname?

    So I think that most of the Kodi staff, in LibreELEC, wrongly starts before the network goes UP (my feeling).

    [hr]
    Running Kodi 17 thanks to LibreELEC on Odroid C2 and on Raspberry Pi 2


  • That would be easy to check. Just restart kodi (as opposed to rebooting) and if it's down to the network not being ready on boot all the problems will disappear.

  • "Wait for network" should resolve these... Or it does not work as expected?

    [hr]
    Running Kodi 17 thanks to LibreELEC on Odroid C2 and on Raspberry Pi 2

  • So, if I understood, do you suggest to:
    1. Reboot LibreELEC
    2. Immediately after, unplug the ethernet cable
    3. See on the screen what happens to Kodi?

    [hr]
    Running Kodi 17 thanks to LibreELEC on Odroid C2 and on Raspberry Pi 2

  • outcave can you post the output from "journalctl -a | pastebinit" and the corresponding kodi.log - this would allow us to see when the network is coming up, and what kodi is doing at that time. But it does appear to be a "network wait" type issue, strange it's not working...


  • So, if I understood, do you suggest to:
    1. Reboot LibreELEC
    2. Immediately after, unplug the ethernet cable
    3. See on the screen what happens to Kodi?


    No. Not at all.
    Easiest way to restart (if it's not an option in your power menu) is:
    Boot up libreelec. Make sure the network's up.
    Log in via SSH (putty if you're on windows).
    'systemctl restart kodi'
    That restarts kodi but everything else (ie network) is still running.


    But I suggest you follow millhouse's advice.

  • milhouse ok, wait in the afternoon (Central Europe Time), I'm not at home now

    [hr]
    Running Kodi 17 thanks to LibreELEC on Odroid C2 and on Raspberry Pi 2

    Edited once, last by outcave ().

  • Hi.


    Have you tried to connect to mysql from another Computer (maybe a second raspi)?


    (if you've done this and i've overread it please ignore)

  • Hello,


    Just wanted to add that I have the same issue. No MySql connection on the last libreelec version with an Amilogic box.
    A RPi3 and an intel box are connecting and working correctly to the same DB.