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';
相關文章
相關標籤/搜索