I am finding a way to reliably restart only mysql service in Ubuntu without harming rest of the processes. I am failing to do so as my command: sudo /etc/init.d/mysql stop makes not only the terminal to hang but also entire CPU gets struct. The CPU usage shoots to almost 100% and nothing happens thereafter until i forcefully close the application entirely. AM i trying to close the mysql service in a wrong way? Can anybody help me on this restarting issue? Any comments are highly appreciated
How to restart mysql successfully in Ubuntu
START MYSQL:
sudo start mysql
RESTART MYSQL:
sudo restart mysql # The service must be running.
STOP MYSQL:
sudo stop mysql # The service must be running.
Â
sudo /etc/init.d/mysql start
should work. Indeed it does, for me:
kojan:~> sudo /etc/init.d/mysql restart
[sudo] password for chris:
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
I used restart rather than start, since it was already running, but the effect is the same. Are you sure you entered your password correctly? 🙂 Have you edited your sudo config at all which would stop this working?
This one.
sudo /etc/init.d/mysql - root -p start
The arguments are wrong. an init.d script only takes start
 or stop
 or restart
 – just one word telling it what to do.Â