Stopping MySQL on macOS
If you've installed MySQL on a Mac operating system, you may need to stop the server to test your application's behavior in the absence of MySQL. Here's how to do it:
Homebrew Installation
If you installed MySQL using Homebrew, use these commands:
- brew services start mysql to start the server.
- brew services stop mysql to stop the server.
- brew services restart mysql to restart the server.
MacPorts Installation
For installations through MacPorts:
- sudo port load mysql57-server to start the server.
- sudo port unload mysql57-server to stop the server.
Binary Installer
In case of binary installer installations:
- sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop to stop the MySQL service.
- sudo /Library/StartupItems/MySQLCOM/MySQLCOM start to start the MySQL service.
- sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart to restart the MySQL service.
The above is the detailed content of How do I stop MySQL on my macOS system?. For more information, please follow other related articles on the PHP Chinese website!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn