An easy and safe way create an administrator account when non-exists on MacOS is to boot into single user mode and mount the OS drive. We actually want to delete a file called the .AppleSetupDone file located in /var/db. This will cause the user wizard to run again where you can create any kind of account again after you exit or reboot out of single user mode including an administrator account.
Here are the steps:
- Turn on your mac pressing the "command ⌘" key + S. This will boot you into Single User Mode
- Mount the drive by typing /sbin/mount -uw /
- type rm /var/db/.AppleSetupDone
- type exit or reboot and it will run the account setup wizard and setup the administrator account