代码之家  ›  专栏  ›  技术社区  ›  jwkoo

brew服务启动mysql与mysql。服务器启动

  •  15
  • jwkoo  · 技术社区  · 7 年前

    以下两者之间的区别是什么?

    brew services start mysql
    
    mysql.server start
    

    我使用的是自制mac os mysql(5.7.21)。

    如果我使用命令打开mysql服务器

    brew services start mysql
    

    然后检查mysql服务器是否打开,

    brew services list
    

    结果是

    mysql started
    

    顺便说一下,如果我使用命令打开mysql服务器

    mysql.server start
    

    然后检查mysql服务器是否打开,

    brew服务列表
    

    结果是

    mysql stopped
    

    他们都成功地打开了mysql服务器。

    我已经用命令检查过了

    lsof -i:3306
    

    但为什么布雷尔主义者的地位不同呢?

    我只通过自制安装了mysql。

    brew install mysql
    

    所以我猜是mysql。server start命令还将与自制mysql相关。

    如有任何建议,将不胜感激。

    1 回复  |  直到 7 年前
        1
  •  9
  •   Elliott Frisch    7 年前

    brew services (一般服务)将在重新启动后自动重新启动;另一个( mysql.server start )不会。这就是区别所在。在没有选项的情况下执行命令应该会产生,

    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.