mac mysql 修改密码

打开终端分别执行下面的两行命令

sudo /usr/local/mysql/support-files/mysql.server stop
sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables

再开一个终端

sudo /usr/local/mysql/bin/mysql -u root 
mysql>use mysql
update user set authentication_string=password('newpassword') where user='root';
    原文作者:asoren
    原文地址: https://segmentfault.com/a/1190000016360517
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞