mac mysql5.7.17 64位dmg首次安裝後修改root密碼

Stop MySQL

sudo /usr/local/mysql/support-files/mysql.server stop
Start it in safe mode:

sudo mysqld_safe --skip-grant-tables
This will be an ongoing command until the process is finished so open another shell/terminal window, and log in without a password as root:

mysql -u root
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
Change the lowercase ‘MyNewPass’ to what you want – and keep the single quotes.

\q
Start MySQL

sudo /usr/local/mysql/support-files/mysql.server start
Thats it, now your root password will be updated.

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章