Mac Mysql 启停命令
mysql.server start
mysql.server stop
mysql.server restart
Mac Mysql自启动配置
brew --prefix mysql
- 从安装目录下找到homebrew.mxcl.mysql.plist文件复制到~/Library/LaunchAgents目录下
cp /usr/local/opt/mysql/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
- 如果不是brew命令安装的,没有homebrew.mxcl.mysql.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>com.mysql.mysqld</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/mysql/bin/mysqld_safe</string>
<string>--user=root</string>
</array>
</dict>
</plist>
评论 (0)