Excessive mental workload situations in pilots will increase their reaction time or cause them to react inappropriately which could impair flight safety. This paper attempts to identify the mental workload of pilots under various flight phases according to a single-flight task in a realistic flight simulator and guides pilots to reasonably allocate their attention to improving flight safety. The scores of the National Aeronautics and Space Administration-Task Load Index (NASA-TLX) scales of each pilot under different flight phases were analyzed by a extensive statistical analysis. The results show that the mental workload levels from high to low are as follows: landing, takeoff, and cruise. Meanwhile, power spectral densities (PSD) of different bands were extracted as features based on a portable 5-channel EEG device, and the Kruskal-Wallis test was used to select features with great significance. And the performances of three machine learning algorithms, the K-Nearest Neighbor (KNN), random forest (RF), and support vector machine (SVM), were compared. The RF model was shown to perform the best in terms of robustness and classification accuracy. This research also proves that it is feasible to research pilots’ mental workload using this portable 5-channel EEG device. The findings of this research could contribute to researches under real flight conditions.