Home >Database >Mysql Tutorial >How to Quiesce MySQL on a Mac OS System?

How to Quiesce MySQL on a Mac OS System?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-11-09 19:47:021040browse

How to Quiesce MySQL on a Mac OS System?

Quiescing 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.

Using Homebrew

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

Using MacPorts

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.

Using Binary Installer

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!

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