the only thing I'd add is to be sure your bike is fit correctly... I was having HORRENDOUS knee problems, especially when climbing, until I got fit. Oh my! What a difference... a month before the fit it hurt to climb at all... a month after the fit I rode my first century with no problems whatsoever...

just something to consider... it shouldn't hurt. tired legs... sure. but pain? no... hope it's a fun ride