When you’re stuck without sysop access to MediaWiki because you cannot remember the sysop details then there’s a handy maintenance script that’s available (if you’ve used the package manager) to reset the sysop username and password.
On Ubuntu server you can run the following command:
php /usr/share/mediawiki/maintenance/changePassword.php --user=sysop --password=password
The script will immediately reset your sysop username and password with what you have entered above.
Now you can log in without any problems!