The former British number one then made no mistake in serving out the match. "Like I said, I've not played a hard-court match for a very long time", Murray said.
Murray played three matches in late June before withdrawing from Wimbledon to better recover from the operation.
"It's not where I want to be ranking wise but the good thing is that when you are right up at the top of the game, it's not easy just to move up one spot", Murray said.
The roar that Andy Murray let out after winning his first-round match at the Washington Open yesterday was as loud as those that followed his second Wimbledon title in 2016 and the time he gave Ivan Lendl a taste of his own medicine by hitting him with a forehand drive-volley during a charity match at the Queen's Club in 2013.
"If I am out here losing first round every single week, I am not going to enjoy that as much", he said. I just fought and tried to make it tough for him.
Playing in just his third tournament in almost a year, the former world No. 1 is trying to raise his ranking back up from its current standing of No. 832.
He took six of seven games in one stretch and was actually one point from serving for the victory, holding a break point while already ahead by a set and 4-3 in the second.
Neither player managed a service break, but Kokkanakis had a break chance at 4-5 in the second set when he could have put the match away.
He faces Edmund again in Washington and admits he has to up his game.
Murray also spoke on working for BBC as a commentator during Wimbledon, and in particular for the quarter-finals match between Juan Martin del Potro and Rafael Nadal: 'It was fun to do it and it was the first time in a long time that I've watched a match as a spectator.
Murray's competitive spirit will want to put things right after the loss in Eastbourne and after experiencing his first hard-court win since the Dubai final of February past year, Murray will really want to keep the ball rolling and keep the momentum running in his favour.
In other matches, Noah Rubin got past Mikhail Youzhny 6-4, 6-4; Tim Smyczek beat Ricardas Berankis 7-6 (4), 6-2, and Malek Jaziri defeated Evgeny Donskoy 6-4, 6-1. I've only played three matches in the past year, so I'm just trying to get back on the match court as much as I can and see how I'm feeling after playing two, three, four, five matches in a week.