I think we all get nervous when playing for others to some extent. Try this, set up a camera in front of your piano and video yourself whenever you practice, it may make you more used to the idea of someone watching you play. Even though the camera isn't a person, it will likely cause the same anxiety you experience when someone is physically there listening to you play.
About being miserable, don't take yourself so seriously, life is what you make it, make it fun. Don't blow things out of proportion, you made a few mistakes so what? He's a piano teacher, if nobody made mistakes he'd be out of a job, that's what he's there for, to help correct them.
If you are younger than 16 read no further.
Here's a mantra:
I'm cool as a cod
I'm funny as a f*ck
Play piano like god
And I'm always in luck
Repeat ad infinitum