A magnitude 5 earthquake hit the Greek coast 34 km south southwest of Kalamata on Wednesday, the US Geological Survey said.