1. Check if mysql exists under /etc/init.d/
ll /etc/init.d/ | grep mysql
Found that there is no mysql file in this directory
2. Query where mysql.server is located
find / -name mysql.server
mysql.server is usually in the mysql directory you installed, and it is compiled and installed by yourself, so you know where the directory is, if you do n’t know, look at it like this
3. Perform the copy operation, / usr / local / mysql / is my own mysql installation directory,
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
Then service mysql start started successfully!