Home > Database > Mysql Tutorial > body text

How Do I Stop MySQL on macOS?

Mary-Kate Olsen
Release: 2024-11-09 14:42:02
Original
291 people have browsed it

How Do I Stop MySQL on macOS?

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
Copy after login

MacPorts:

sudo port load mysql57-server
sudo port unload mysql57-server
Copy after login

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
Copy after login

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!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template