MySQL Isuue and in need of a Linux Shell Command Syntax
My MySQL server seems to stop on it's own. When i try to start it via it would not start as some mysql process would be stuck in the memory. I would then SSH to the server and do a pswaux | grel mysql; i would then kill each mysql process manually and then MySQL would start just fine.There is a port monitor utility installed on my server which notifies me whenever mysql goes down. This monitor tool can be configured to execute any command when a service goes down. I specified the command "service mysql restart" but this command would not work as it doesn't kill the my mysql processes still in the memory and hence mysql would not start.
My Question to is;
How in One Line (as the monitor utlity just takes one line as an input command to execute when a service goes down) can i specify a command which would kill all mysql processes in memory and then restart mysql.
Please let me know the syntax.