John Mayer has been granted a restraining order against an obsessed fan who allegedly made threats about the star and his team.