[[https://www.mediawiki.org/wiki/Manual:$wgSharedDB|$wgSharedDB]] (shared user tables) is a low-effort single-sign-on mechanism that isn't very reliable - some parts of the code support it, some don't. (See e.g. T18794, T299766, T214011, T337185, T104830, T389758.) It's also possible to redeclare the set of tables that get shared via [[https://www.mediawiki.org/wiki/Manual:$wgSharedTables|$wgSharedTables]], which seems like a majestically bad idea, and depending on the exact tables might work, break slightly or break horribly.
We should deprecate and remove this feature, and - if feasible - replace it with something more maintainable:
* [[https://www.mediawiki.org/wiki/Manual:$wgVirtualDomainsMapping|virtual domains]]
* an extension to cover the common use case of sharing users between wikis on a farm (probably via {T359116})
* or maybe just remove without replacement, although that would leave third-party users without a good way to run a wiki farm without outsourcing login somehow.