Reset MySQL root password using ALTER USER statement after install on Mac

后端 未结 19 2189
慢半拍i
慢半拍i 2020-11-29 14:21

I\'m new to the whole Mac experience. I recently installed MySQL and it seems I have to reset the password after install. It won\'t let me do anything else.

Now I al

19条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 15:05

    I have same problem on Mac

    First, log in mysql with sandbox mode

    mysql -u  -p --connect-expired-password
    

    Then, set password

    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('XXXX');
    
    Query OK, 0 rows affected, 1 warning (0.01 sec)
    

    It works for me ~

    via: https://dba.stackexchange.com/questions/118852/your-paswssword-has-expired-after-restart-mysql-when-updated-mysql-5-7-8-rcde

提交回复
热议问题