Home >Database >Mysql Tutorial >How to Quiesce MySQL on a Mac OS System?
MySQL is a popular database management system that can be installed on Mac OS using various methods, including MacPorts and Homebrew. One common task for developers is to stop the MySQL server to test how their application functions when the database is unavailable. This guide provides detailed instructions on how to halt the MySQL server on a Mac OS computer depending on the installation method used.
Homebrew is a package manager for Mac OS. If MySQL was installed using Homebrew, the following commands can be used to control the server:
brew services start mysql brew services stop mysql brew services restart mysql
MacPorts is another package manager for Mac OS. For MySQL installations managed by MacPorts, the following commands are effective:
sudo port load mysql57-server sudo port unload mysql57-server
It's important to note that the changes made using MacPorts are persistent after a reboot.
If MySQL was installed using the official binary installer, the following commands can be used:
sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop sudo /Library/StartupItems/MySQLCOM/MySQLCOM start sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart
The above is the detailed content of How to Quiesce MySQL on a Mac OS System?. For more information, please follow other related articles on the PHP Chinese website!