I have seen the same problem on PR4100 after OS5 upgrade. I don’t have a solution, but I understand the problem. Maybe WD can help? (or someone who knows the Linux internals of the box better)
The PR4100 is using MariaDB as the mysql server. Like you, I had to re-add my kodi user but it still did not work.
The MariaDB has my.cnf configuration file (/etc/my.cnf) which has a bind_address of 127.0.0.1 which is the default “loopback” address which means the sql server is not accessible from the outside world (i.e. the kodi client)
The config file needs to be set to the NAS IP address (i.e. your.nas.ip.address) in order to accept connections from the outside world.
I was able to ssh in and change this file (and with Linux shenanigans restart MariaDB so the change took effect)… and the Kodi library started working again, so I know that this is the root of the problem.
Unfortunately, when you restart the PR4100, the my.cnf config file gets overwritten with the loopback address and thus shuts off access. So without a manual “restart of the sql server with the bind address fixed”… it locks itself down and prevents kodi (or any) outside connection.
I actually did a ps to look at running services and killed the mysql process, and then restarted which worked, but may have had unintended side effects as perhaps there were expected optional parameters needed by other systems when restarting the server.
The command below is a better approach but I haven’t tried it, and I can’t recall the exact sequence without going through it again. I am just not at my pc right now.
edit /etc/my.cnf to change 127.0.0.1 to 0.0.0.0
restart the mysql server by doing: python3 /usr/bin/mysql_reset.py --reboot