We report calculations of rate coefficients for the rovibrational excitation of H-2 and HD by H. The calculations relate explicitly to non-reactive scattering, excluding the proton-exchange channels. For vibrationally inelastic transitions, the new rate coefficients at T approximate to 1000 K are larger than the results of earlier calculations in which the vibrational motion was treated approximately, by means of a simple harmonic oscillator model. As a result, much better agreement is obtained with the empirical estimates by Allers et al. of the rate coefficients for vibrational relaxation of the levels (v, j) = (1, 3) and (2, 3) of H-2. However, the effects of the new data on the results of illustrative astrophysical models - of a C-type shock wave and of the gravitational collapse of a condensation of the primordial gas-are less pronounced than the changes to the rate coefficients for vibrationally inelastic transitions might suggest; we explain why this is the case.