启动:sudo /usr/local/mysql/support-files/mysql.server start
停止:sudo /usr/local/mysql/support-files/mysql.server stop
重启:sudo /usr/local/mysql/support-files/mysql.server restart
重置密码:
1.停止mysql server.
2.打开终端,输入:
sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
3 . 打开另一个新终端,输入:
sudo /usr/local/mysql/bin/mysql -u root
UPDATE mysql.user SET authentication_string=PASSWORD('新密码') WHERE User='root';
4.重启MySQL.
卸载:
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
vim /etc/hostconfig (and removed the line MYSQLCOM=-YES-)
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*