Why are you attributing this to Socrates? He's not really known as a motivational kind of guy, he's more known as the guy who trolled people IRL until the city of Athens had him executed for corrupting the youth. A little googling attributes this anecdote to motivational speaker Eric Thomas, telling a story about some unnamed "guru".
Most likely if you asked Socrates what the secret to success was, he'd respond by asking "so what exactly is this 'success' thing you want to know the secret of?"