What is the difference between those two below?
brew services start mysql
mysql.server start
I am using homebrew mac os mysql(5.7.21).
If I turn on the mysql server using a command
brew services start mysql
then check if that mysql server is on,
brew services list
The result is
mysql started
By the way, If I turn on the mysql server using a command
mysql.server start
then check if that mysql server is on,
brew services list
The result is
mysql stopped
Both of them successfully turn on the mysql server.
I have checked it using a command
lsof -i:3306
But why is that brewlist status different?
I only installed mysql via homebrew.
brew install mysql
so I guesssed that mysql.server start command also would be related to the homebrew mysql.
Any advice would be appreciated.
Open macOS system preferences and select the MySQL preference panel, and then execute Start MySQL Server. The Instances page includes an option to start or stop MySQL, and Initialize Database recreates the data/ directory.
d command to start/stop your MySQL server. Lastly, you can also use the systemctl command to start, stop, and restart applications on Linux, including MySQL.
brew services
(services in general) will restart automatically after rebooting; the other (mysql.server start
) will not. That is the difference. Executing the command with no options should yield,
tigger2:Downloads efrisch$ brew services brew services [-v|--verbose] [list | run | start | stop | restart | cleanup] [...] Easily start and stop formulae via launchctl. With -v or --verbose, print more detail. Integrates Homebrew formulae with macOS' launchctl manager. Services can be added to either /Library/LaunchDaemons or ~/Library/LaunchAgents. Basically, items in /Library/LaunchDaemons are started at boot, while those in ~/Library/LaunchAgents are started at login.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With