Featured image of post MySQL 設定root密碼

MySQL 設定root密碼


ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

UPDATE user SET authentication_string=password('new_password') WHERE user='root';

延伸閱讀: 登入 MySQL localhost 錯誤 Source: ERROR 1064 (42000): You have an error in your SQL syntax; Want to configure a password as root being the user  

Licensed under CC BY-NC-SA 4.0