This study focuses on the security of 5G mobile network major technology called Multi-Access Edge Computing (MEC) and its susceptibility to distributed denial of service (DDoS) attacks. The goal of the research is to address the effects of DDoS attacks and implement effective mitigation techniques. Several supervised Machine Learning (ML) techniques, which include Random Forest (RF), Decision Tree, Naïve Bayes, K-Nearest Neighbour, Logistics Regression, and Blending/Stack Model, are evaluated using multiple performance metrics such as accuracy, detection/recall, F1-Measure, Matthew’s correlation coefficient, Receiver Operating Characteristic, and Area Under Receiver Operating Characteristic. According to literature, ML algorithms achieve the best performance in mitigating DDoS attacks, therefore, they can be optimized to enhance their effectiveness. The research provides an overview of the existing mitigation schemes in the MEC and proposes a DDoS mitigation scheme. The findings show that hybrid models outperformed traditional ML models. Among the mitigation techniques evaluated, RF proved to be the most effective in mitigating DDoS attacks in MEC.