We measure the sum of the neutrino particle masses using the three-dimensional galaxy power spectrum of the Sloan Digital Sky Survey III (SDSS-III) Baryon Oscillation Spectroscopic Survey Data Release 9 the constant MASS (CMASS) galaxy sample. Combined with the cosmic microwave background, supernova and additional baryonic acoustic oscillation data, we find upper 95 per cent confidence limits (CL) of the neutrino mass Σmν < 0.340 eV within a flat Λ cold dark matter (ΛCDM) background, and Σmν < 0.821 eV, assuming a more general background cosmological model. The number of neutrino species is measured to be Neff = 4.308 ± 0.794 and 4.032+0.870-0.894 for these two cases, respectively. We study and quantify the effect of several factors on the neutrino measurements, including the galaxy power spectrum bias model, the effect of redshift-space distortion, the cut-off scale of the power spectrum and the choice of additional data. The impact of neutrinos with unknown masses on other cosmological parameter measurements is investigated. The fractional matter density and the Hubble parameter are measured to be ΩM=0.2796±0.0097, H0=69.72+0.90−0.91 km s−1 Mpc−1 (flat ΛCDM) and ΩM=0.2798+0.0132−0.0136, H0=73.78+3.16−3.17 km s−1 Mpc−1 (more general background model). Based on a Chevallier–Polarski–Linder parametrization of the equation-of-state w of dark energy, we find that w = −1 is consistent with observations, even allowing for neutrinos. Similarly, the curvature ΩK and the running of the spectral index αs are both consistent with zero. The tensor-to-scalar ratio is constrained down to r < 0.198 (95 per cent CL, flat ΛCDM) and r < 0.440 (95 per cent CL, more general background model).