I have forgotten my username and password of admin in MarkLogic 5. I tried to uninstall the software MarkLogic 5 and install that again. But every time it is asking for username
Getting past the admin password is supposed to be hard (or impossible), of course. You mentioned uninstalling MarkLogic; if you aren't worried about preserving data, you can uninstall MarkLogic and remove the data directory (/var/opt/MarkLogic on Linux), then when you reinstall you'll be prompted to enter a new admin password.
edit: adding code from Jordan Stewart's comment to provide better formatting:
# stop Marklogic using a service
sudo service MarkLogic stop
# change directories to MarkLogic data dir
cd var/opt/MarkLogic/
# remove everything including folder, this is dangerous
sudo rm -rf *
# start MarkLogic
sudo service MarkLogic start