Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

how do I stop mysql running on my server? Standard solutions not working

Writer Emily Wong

I have done a remote log-in into my Ubuntu 14.04 server as a root user.

When I try:

sudo stop mysql

I get:

stop: unknown instance:

When I try:

sudo service mysql stop

I get:

stop: unknown instance:

I read a post somewhere where someone posted a similar question, the answer being that the server is most likely already not running so I tried:

mysqladmin -u root -p status

And I get Uptime: 1543 Threads: 1 Questions: 500 etc...

...which means the server is indeed running.

So, how do I stop mysql? I'm sure I tried sudo stop mysql before and it worked.

Today I added a password for access to the mysql db as a root user, could that be something to do with it?

I know the password is working ok because I need to enter it in order to log into phpMyAdmin.

With service mysql status I get mysql stop/waiting like it's hanging - shouldn't it just shut down eventually?

5 Answers

Try sudo systemctl status mysqld then, if successful, sudo systemctl stop mysqld.

The name of the service may be different (officially is mysqld).

3

Stop MySQL: sudo /etc/init.d/mysql stop

Stop Apache: sudo /etc/init.d/apache2 stop

You are missing the command 'Service'.

sudo service mysql stop

1

Here is how I did it eventually.

I looked up the Process ID (PID) for mysqld_safe using:

ps -A

This will show all the PIDs currently running on the server.

mysqld_safe was something like 34567

Then I did the command: kill -KILL 34567

Also, I killed the PID of mysqld, which was something like 34678:

kill -KILL 34678

Then I did service mysql start

All working good now.

The problem with sudo service mysql stop is that systemctl will restart the service after a few minutes. You need to stop it with systemctl.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy