在命令窗口找到 mysql. 服务的目录文件

默认是

个人\磁盘\usr\local\mysql\support-files 目录下执行命令
启动MySQL服务
sudo /usr/local/MySQL/support-files/mysql.server start

停止MySQL服务
sudo /usr/local/mysql/support-files/mysql.server stop

重启MySQL服务
sudo /usr/local/mysql/support-files/mysql.server restart