As part of a general tightening of security, I want to change the name of the admin user on my multisite install to something less commonly used. This user is admin on all five sites in the network and has the grand, exalted title of Super Admin on the network.
Using MySQL (technically MariaDB) to change the name…
update wp_users set user_login = "new_username" where ID = 1;
update wp_users set user_nicename = "new_username" where ID = 1;
… didn’t pose much of a problem.
The problem I had was that when I now logged in with new_username I was no longer super admin. My user still had all his posts to his name, all his configurations and metadata etc. He was still admin on all five sites. But there was no way to access the network section of the control panel, i.e. the dropdown menu didn’t list the network control panel, only that of the five sites.
This leads me to believe that there is some additional setting that links the super admin title to the admin user. I have travled the database looking for some clues as to where there might be some setting that names the super admin (and specifically names him “admin”?) but I have come up short.
Any suggestions?
NB: I know I can setup a new user and transfer all posts and responsibilities but that would open up a whole new can of worms, so if at all possible I don’t want to go down that road. Also I would rather like to learn how my setup works on the db level.
EDIT: Based on the information supplied by user42826, I found that adding the following command to the two above did the trick:
update wp_sitemeta set meta_value = 'a:1:{i:0;s:5:"new_u";}' where meta_key = 'site_admins';
Note that ‘new_u’ is five characters, similarly to ‘admin’. The new meta_value string was copy-pasted from the old string with the exception of ‘new_u’ replacing ‘admin’.