mac 下mysql自定义命令控制

Add to your .bash_profile these lines:
alias mysql.start="sudo /usr/local/mysql/support-files/mysql.server start"
alias mysql.stop="sudo /usr/local/mysql/support-files/mysql.server stop"
alias mysql.restart="sudo /usr/local/mysql/support-files/mysql.server restart"
alias mysql.status="sudo /usr/local/mysql/support-files/mysql.server status"

Now u can run mysql.start command from your shell and it will start mysql. To use the commands in the same session without shell restart run command: source ~/.bash_profile

  

原文地址:https://www.cnblogs.com/cheflone/p/13160014.html