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.