What year model Mac Mini?
see > https://support.apple.com/en-us/HT201894
Could be a bad power supply, but it sounds more like a bad/loose wall outlet or bad power cord.
- Reset the SMC as per the desktop instructions at > https://support.apple.com/en-us/HT201295
- Go to Apple > System Preferences > Energy Saver > uncheck "Startup automatically after a power failure" then if the Mac Mini looses power it will stay off and not restart automatically.
- Check the power cord connection on the back of the Mac Mini and at the wall outlet to make sure that they are snug and not loose.
- Try moving the Mac Mini to another wall outlet.
- Try another power cord.
If none of that leads you to the problem, then it's time to make a service appointment at you local Apple Authorized Service Provider.