您的位置:首页 > 博客中心 > 数据库 >

mac 下添加mysql开机启动

时间:2022-03-14 02:56

1.添加文件
touch 
/Library/LaunchDaemons/com.mysql.mysql.plist
2.添加内容
<?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>com.mysql.mysqld</string>  
    <key>ProgramArguments</key>  
    <array>  
    <string>/usr/local/mysql/bin/mysqld_safe</string>  
    <string>--user=root</string>  
    </array>    
  </dict>  
</plist>  

3.添加 后重启
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist


热门排行

今日推荐

热门手游