This paper investigates a covariance-based learning approach for intelligent reflecting surface (IRS) aided activity detection in massive machine-type communications (mMTC). In the conventional scenario without IRS, the covariance-based approach has been demonstrated to outperform the compressed sensing approach, as the covariance-based approach can well exploit the probability density function (PDF) of the received signals at the base station (BS). However, when taking the impact of the IRS into account, due to the newly introduced cascaded channels, it is quite difficult to obtain the exact PDF of the received signals at the BS. To tackle this challenge, we propose an approximation for the intended PDF by modeling a correlation parameter in the covariance matrix of the received signals. Based on the covariance-based formulation, a learning approach is further proposed to automatically learn the correlation parameter. Simulation results demonstrate the performance of the covariance-based activity detection, and the superiority of the proposed covariance-based learning approach.