MySql - resetting deleted root user and password

resetting an accidently deleted mysql root user or password requires you to have command line access to mysql daemon which needs to be stopped and restarted.