How to Halt MySQL on macOS: A Guide for Different Installations
Need to temporarily disable MySQL to observe the impact on your application? Whether you installed MySQL using the official binary, MacPorts, or Homebrew, follow these commands to stop the server:
Homebrew:
brew services start mysql brew services stop mysql brew services restart mysql
MacPorts:
sudo port load mysql57-server sudo port unload mysql57-server
Note that using MacPorts, this action persists even after rebooting.
Binary Installer:
sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop sudo /Library/StartupItems/MySQLCOM/MySQLCOM start sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart
By following these commands, you can swiftly suspend the MySQL server, allowing you to test your application's behavior in the absence of its database connection.
The above is the detailed content of How Do I Stop MySQL on macOS?. For more information, please follow other related articles on the PHP Chinese website!