0

On OS X I need to reset the password of MySQL. It was installed with Homebrew.

I found this article which explains how reset my password: https://dev.to/oneearedmusic/access-denied-reset-mysql-root-user-password-2hk4

However, step 1 gives me issues. It says:

Shut down Mysql. Try

sudo service mysql stop

or

sudo /etc/init.d/mysql stop

or looking up the PID and killing it.

The first two options give me:

command not found

I'm searching for how to 'look up' the PID, what it is, and how to use it, but I'm getting a lot of noise so far in my search results...

Why am I getting command not found. How can I stop my server?

I'm using version 15.1 Distrib 10.3.13-MariaDB, for osx10.14 (x86_64) using readline 5.1

0

There are variety of ways to restart MySQL in MacOS (before MySQL 5.7)

sudo /usr/local/mysql/support-files/mysql.server stop
sudo /usr/local/mysql/support-files/mysql.server start

or for MySQL 5.7 up

sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
  • The first stop gives me command not found. The second gives me No such file or directory. – user187302 Aug 8 at 20:21
  • @user187302 - Different OSs put the files in different places. You must locate it. Be aware that the name could be quite different. mysql is a client tool, so that name is wrong. The daemon is called mysqld, but it might go by mysql.server. Etc, etc. – Rick James Aug 8 at 22:30
0

This might work on all OSs:

mysqladmin shutdown

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.