The installation script of 1.31 LTS has a major bug in it. Do not install MediaWiki 1.31. Hold off until this major issue is fixed. The account that is created during installation does not have sysop privileges. Actually, the data in the data database seems to be fine. The account is assigned to the group ("sysop"). Therefore the problem is most likely in the code somewhere. Maybe it has something to do with sometimes the sysop account being called "administrator" and sometimes the sysop account being called "administrators". At the end of the day, the installation does not work to a level where a regular user will not be able to fix the problem.
I already wasted a whole day and half trying to install this. Don't waste your time and energy. At the end of the day, you will just be frustrated and angry.