San Diego mayor agrees to resign