MySQL Access Problem

I have now decided to go back to a local database. In the past I had 3 clients that were supposed to display the same content and so I decided to use a MySQL DB, but somehow I can’t get the problem under control.

Now my question. What do I have to do to switch to a local database? Is it enough to delete the advancedsettings.xml, restart Kodi and then simply re-integrate the sources?

Thank you very much for your continued support.

Actually, just remove all instance of mysql configuration. That should do it.
I’d re-scan all medias though.

@Smurphy

its only the advancedsettings.xml and in the osmc settings to deactivate the MySQL Options, right?

Actually that is the same, MyOSMC writes the advancedsettings file. So good enough to remove there, reboot and rescan.
You will loose your watched status info

1 Like

I know. I will write down the status to rebuild it manually. Thanks @fzinken

So. It’s not the database that goes into “sleep mode”, but the NAS itself. Although I haven’t activated anything in this regard. Since MySQL and films/series are on the NAS, I’ve now noticed that when I rescan (after I’ve re-integrated the source) it keeps showing the message “Wake on LAN 192.168.19.2” and then it shows me that new content has been found, but it doesn’t show it in the DB (which is now local). If I go to the Kodi file manager and call up one of the new contents (film/series), the content (film/series) works. There also only seem to be problems with the NFS connections.
The maximum NFS protocol is set to NFSv4.1 (but I can only specify NFSv3 as the lowest protocol)
The NFS range includes: NFSv2, NFSv3, NFSv4, NFSv4.1

FYI - I am using a constant connection to my server (NAS) as it is only 24/7 (Electricity is way cheaper in France than in Germany :wink: ).
I did put the mount statement into the /etc/fstab like this:

# rootfs is not mounted in fstab as we do it via initramfs. Uncomment for remount (slower boot)
#/dev/vero-nand/root  /    ext4      defaults,noatime    0   0
192.168.5.13:/export/Movies   /net/Movies    nfs  auto,x-systemd.automount,soft  0  0
192.168.5.13:/export/TVShows  /net/TVShows   nfs  auto,x-systemd.automount,soft  0  0
192.168.5.13:/export/Music    /net/Music     nfs  auto,x-systemd.automount,soft  0  0
192.168.5.13:/export/HDTracks /net/HDTracks  nfs  auto,x-systemd.automount,soft  0  0
192.168.5.13:/export/Pictures /net/Pictures  nfs  auto,x-systemd.automount,soft  0  0
192.168.5.13:/export/kodi /net/kodi  nfs  auto,x-systemd.automount,soft  0  0

so I have it all on the my NAS. 3 devices accessing it.
My advanced settings looks like this:

<?xml version="1.0" encoding="utf-8"?>
<advancedsettings>
 <pathsubstitution>
 </pathsubstitution>
        <videodatabase>
                <name>MyVideos</name>
                <host>192.168.5.12</host>
                <user>kodi</user>
                <pass>verysecurepass</pass>
                <type>mysql</type>
                <port>3306</port>
        </videodatabase>
        <musicdatabase>
                <name>MyMusic</name>
                <host>192.168.5.12</host>
                <user>kodi</user>
                <pass>verysecurepass</pass>
                <type>mysql</type>
                <port>3306</port>
        </musicdatabase>
        <videolibrary>
                <importwatchedstate>true</importwatchedstate>
                <importresumepoint>true</importresumepoint>
                <cleanonupdate>true</cleanonupdate>
        </videolibrary>
        <playcountminimumpercent>95</playcountminimumpercent>
        <skiploopfilter>0</skiploopfilter>
        <cache>
                <buffermode>1</buffermode>
                <memorysize>94371840</memorysize>
                <readfactor>4.0</readfactor>
        </cache>
    <network>
        <disablehttp2>true</disablehttp2><!--stutter problems on livestreams-->
    </network>
</advancedsettings>

Note, the different IP addresses in advanced settings and fstab come from the fact that I run the DB’s on kubernetes, and I dedicated one IP to all database stuff (using Alias IP’s on the interfaces).
But it is the same machine.
In this setup, I cannot send my NAS to sleep!

This is all I do. an d it works :}

@Smurphy

I don’t think I can explain properly what the problem is.
I use KODI on a media player in the living room (for about 5 years or so) and on a Synology NAS in the study (unfortunately connected via DLAN because there is no other option structurally) are the films/series and the DB that Kodi accesses with an advancedsettings.xml. The database was set up correctly years ago and has been updated over the years through a DB migration. The user that is required has all the rights, including “GRANT”.
So far everything was fine.

Now I have a cron job running that restarts the media player/Kodi every morning at 5:00 a.m. so that it doesn’t “run through” for too long and all connections are “fresh” again. All that is done is a restart.

During all this time I haven’t changed any settings “myself” and about 6 weeks ago (I’ve been looking for a solution for that long) the system was restarted at 5:00 a.m. and after that no more films/series were displayed in the KODI interface.

When I then tried to access it “manually” via the file manager, I got the “SAD smiley” and I think the system even rebooted.

I had noticed that I had a “MyVideos121” and a “MyVideos131” in the DB. After some research and questions, I deleted the “MyVideos131” and restarted Kodi. The DB migration display came up again and when the system was restarted, films/series were displayed again.

When I then accessed a film/series, the content was played correctly. As soon as I waited a bit (no idea if it was 5, 10 or 15 minutes) and then tried to click on the Movies menu item again, I got the message “Server needs to be woken up…” (or something similar) followed by “Server needs to be woken up for a longer period of time”. Unfortunately, to no avail. I did get the films displayed as covers with a synopsis, but when I then wanted to play a film I got the “SAD smiley” again.

When I then restarted, there were no more covers or anything like that to be seen. As if the DB was empty or not accessible.

In the DB I then had “MyVideos121” and “MyVideos131” again.

In the Kodi debug log you could then see that the SQLD went into sleep mode. But I didn’t set the MySQL DB to sleep (or the hard drives to sleep) nor do I know where I could set a sleep mode in the MySQL DB.

Then I ran “Flush hosts” on the SQL DB because I suspected that my client had been rejected due to too many unsuccessful requests. That was also unsuccessful. Then I deactivated the SQL DB and tried to create the DB locally. That was also unsuccessful. It seems to me that the connection to the NAS is being prevented/disrupted by something, which means that neither films nor the DB can be accessed temporarily.

I hope I’ve been able to get it across correctly now.

Yes, and that’s when it shows an emtpy content or falls back to the local DB’s → .kodi/userdata/Database/* - check if there is a DB in there. It’s probaly falling back to that one when it can’t reach the mysql DB.

Yes thats what i also think. But why can´t Kodi get access to the MySQL DB? Thats the big question.

I think the wait for network is solved faster than the NAS. What I mean, when the NAs wakes up, network is restaured first (so pingable), but DB is not, it takes longer.
Kodi tries to connect to DB (as network is there), but can’t reach the service, so falls back to local DB.

Does it align with the time that you upgraded to Kodi v21?

It could be but i dont know. Why you ask fzinken.
It seems to be related to the fact that some component (for whatever reason) is going into sleep mode. In any case, I haven’t configured anything. That’s what makes things so difficult.

As there were reports with WakeOnLan after the upgrade.

Yes it seems that your NAS database goes to sleep.
I am wondering if it would make sense if you use a Docker MySQL on the NAS instead the native service

But what does “Wake on Lan” have to do with the Kodi version?

Everything worked perfectly before

Well that is still unclear but people reported issues.
So maybe it is not related and just related to the DB Update issue that you have. Hard to tell.