This paper investigates the optimal training duration and the optimal power allocation for the training and the data transmission that maximize the ergodic sum rate in single-cell uplink massive MIMO with MMSE receivers. Our channel model assumes that each user experiences the same spatial channel correlation. The expression for the ergodic sum rate is obtained in the large system regime where the number of antennas ( $N$ ) at the base station and the number of users ( $K$ ) tend to infinity with a fixed ratio. Interestingly, we show that the optimal training duration is equal to $K$ and independent of the spatial correlation. We also derive the optimal power allocation that in facts depends on the spatial correlation, the channel coherence interval, and the uplink SNR. We show that more energy should be allocated for the training if the data transmission duration ( $t_{d}$ ) is less than $K$ , and vice versa. Moreover, equal power allocation is optimal when $t_{d}=K$ . We also obtain an approximation for the optimal power allocation that depends on the mean of the correlation matrix eigenvalues. Numerical simulations show that our results based on the large system approximation are accurate and applicable for finite-size systems. The simulations also show that (1) the resulting ergodic sum rates obtained by employing the optimal power allocation and its approximation are indistinguishable, and (2) the optimal power allocation obtained from the uncorrelated channel model can be applied to the cases involving the correlated channels with indiscernible penalties on the ergodic sum rates.