This paper develops optimal beamforming design in a downlink multi-input-multi-output (MIMO) dual-function radar-communication (DFRC) system to maximize the weighted sum-rate of communicating users under the prescribed transmit covariance constraint for radar performance guarantee. In single-user case, we show that the transmit covariance constraint implies inherent orthogonality among beamforming vectors in use. Then leveraging a corollary of Cauchy's interlace theorem, we derive the globally optimal beamforming solution in closed form. For multi-user case, we exploit the connection between weighted sum-rate and weighted minimum-mean-squared-error (MMSE) to reformulate the problem, and develop a block-coordinate-descent (BCD) type algorithm with closed-form solution derived for the subproblem in each step and fast convergence to a locally optimal beamforming design. Numerical results validate the effectiveness of our proposed schemes.