久保圭司
久保圭司

Reputation: 589

How to stop mysql

I run mysql.server stop

then

$ mysql.server stop
Shutting down MySQL
.. SUCCESS! 

And mysql configuration is like this. It seems to be stopped.

enter image description here

However, I can run mysql -uroot

$ mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.15 Homebrew

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

What is happening ? I guess that two mysql are installed because I used homebrew to install mysql. If so, how to stop another one ?

Upvotes: 0

Views: 282

Answers (2)

PatrickChen
PatrickChen

Reputation: 1420

if you want to make sure, you could always ps the MySQL process.
Also, you could check if the port to see if it's been occupied by the MySQL process.

Upvotes: 1

久保圭司
久保圭司

Reputation: 589

I found the reason. I once run brew services start mysql.

So, even if i run mysql.server stop, soon mysql server restarted.

I disabled auto restart by brew services stop mysql

Upvotes: 0

Related Questions