The 5.9-magnitude quake damaged buildings in Melbourne, but there were no immediate reports of serious injuries or deaths.