Quantcast
Channel: How do I start/stop mysql server? - Ask Ubuntu
Viewing all articles
Browse latest Browse all 12

Answer by Caesium for How do I start/stop mysql server?

$
0
0

Your first two commands weren't run as root so that is expected behaviour. You need to be root to stop/start mysql.

However:

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. You cannot give it multiple arguments as you were trying to do.

Anyway, the short answer is the one you actually got to work, is the recommended way. service is replacing all the init.d scripts over time, so you should get into the habit of using service. The page you link to was written in 2008, so has to be taken with some salt :)


Viewing all articles
Browse latest Browse all 12

Trending Articles