Murray let a 40-15 lead slip when serving for the match and saved another break point, before match point three slipped away after the umpire overturned a call when checking a mark.
The drama was not to last long, however, and a forehand error from Hanescu gave Murray victory at the fourth attempt.
won an impressive 70% of his service points as he made light work of his match against qualifier Hernandez.
The 21-year-old world number three, who currently holds a 170-point lead over Murray in the rankings, also converted five of 14 break points to set up a third round clash with either Monaco wild card Jean-Rene Lisnard or Spaniard Albert Montanes.
In the battle of two former Grand Slam champions Russian
won in straight sets against Australian Lleyton Hewitt 6-4 7-5.
Safin faces Nicolas Lapentti in the next round after the Ecuadorian overcame Czech Radek Stepanek on Monday.
There were two surprise results early on Tuesday as sixth seed
and ninth seed
Monfils lost 6-3 6-1 to Janko Tipsarevic before fellow Frenchman Simon went down 7-5 6-1 to Andreas Beck.
"I don't remember ever playing so badly," said Simon. "Nothing was right. Nothing was working. My forehand, my backhand, my serve, nothing. I believe this match is a record."
And 12th seed
heaped further misery on the French as he beat Paul-Henri Mathieu 6-4 3-6 6-3.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.