• Mac mysql 设置开机自启动


    创建启动目录,如果没有的话

    mkdir -p ~/Library/LaunchAgents
    

    将启动文件拷贝进去

    % cp /opt/homebrew/Cellar/mysql@5.7/5.7.34/homebrew.mxcl.mysql@5.7.plist ~/Library/LaunchAgents
    

    设置开启启动

    % launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist 
    

    我们可以看一下,里面的内容

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>KeepAlive</key>
      <true/>
      <key>Label</key>
      <string>homebrew.mxcl.mysql@5.7</string>
      <key>ProgramArguments</key>
      <array>
        <string>/opt/homebrew/opt/mysql@5.7/bin/mysqld_safe</string>
        <string>--datadir=/opt/homebrew/var/mysql</string>
      </array>
      <key>RunAtLoad</key>
      <true/>
      <key>WorkingDirectory</key>
      <string>/opt/homebrew/var/mysql</string>
    </dict>
    </plist>
    
  • 相关阅读:
    中间件
    进程的概念
    操作系统必会
    粘包现象及处理方式
    双下方法
    异常处理
    网络编程基础
    osi七层协议
    面向对象初识
    Django 中间件
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/14852279.html
Copyright © 2020-2023  润新知