Hybrid energy harvesters under external excitation have complex dynamical behavior and the superiority of promoting energy harvesting efficiency. Sometimes, it is difficult to model the governing equations of the hybrid energy harvesting system precisely, especially under external excitation. Accompanied with machine learning, data-driven methods play an important role in discovering the governing equations from massive datasets. Recently, there are many studies of data-driven models done in aspect of ordinary differential equations and stochastic differential equations (SDEs). However, few studies are to discover the governing equations for hybrid energy harvesting system under harmonic excitation and Gaussian white noise (GWN). Thus, in this paper, a data-driven approach, with least square and sparse constraint, is devised to discover governing equations of the systems from observed data. Firstly, the algorithm processing and pseudo code are given. Then, the effectiveness and accuracy of the method are verified by taking two examples with harmonic excitation and GWN, respectively. For harmonic excitation, all coefficients of the system can be simultaneously learned. For GWN, we approximate the drift term and diffusion term by using Kramers-Moyal formulas, and separately learn the coefficients of the drift term and diffusion term. Cross-Validation (CV) and Mean-square error (MSE) are utilized to obtain the optimal number of iterations. Finally, the comparisons between true values and learned values are depicted to demonstrate that the approach is well utilized to obtain the governing equations for hybrid energy harvester under harmonic excitation and GWN.