Home >Database >Mysql Tutorial >How to Stop MySQL on a Mac OS Installation?

How to Stop MySQL on a Mac OS Installation?

Patricia Arquette
Patricia ArquetteOriginal
2024-11-14 14:50:02597browse

How to Stop MySQL on a Mac OS Installation?

Methods to Stop MySQL on a Mac OS Installation

To effectively test application behavior during MySQL outages, shutting down the MySQL server is necessary. Here are the commands required to accomplish this, depending on the installation method used:

Homebrew

Manage MySQL services using the following commands:

  • Start: brew services start mysql
  • Stop: brew services stop mysql
  • Restart: brew services restart mysql

MacPorts

Load and unload the MySQL server with these commands:

  • Load: sudo port load mysql57-server
  • Unload: sudo port unload mysql57-server

Note: Changes made using MacPorts persist after a system reboot.

Binary Installer

Utilize the following commands:

  • Stop: sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
  • Start: sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
  • Restart: sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart

The above is the detailed content of How to Stop MySQL on a Mac OS Installation?. 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