The cloud computing holds a massive quantity of private and secret data and information, It uses the internet to communicate with another party so it contain a number of unreliable strings that can be demonstrated to be loopholes, therefore protecting data stored on the cloud is often a serious risk. one of the most serious security dangers to cloud are SQL Injection Attacks (SQLIA), It sends a susceptible query to affect server systems, allowing attackers to gain illegal access to databases, resulting in identity theft and security breaches. In this research we have studied and investigated the recent published approaches to SQL injection attacks detection, and we have presented SQL injection detection tool based on machine learning, The model classifies SQL injection queries into two categories: attack and legitimate. The model is training with four machine learning algorithms We have employed K-Nearest Neighbors (KNN), Multinomial Naive Bayes (MNB), Decision Tree (DT), and Support Vector Machine (SVM), after performing data preprocessing and feature extraction, we compared the values obtained by each model to determine the best model in SQL injection detection. The result show SVM produced the best results with an accuracy of 99.42%. after that The decision tree algorithm obtained results with an accuracy of 99.4%. Then MNB algorithm produced a 97.09%. However KNN produced the worst results, with an accuracy of 92.45 %. Therefore we have found that our models produce near-perfect results.