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

后端 未结 19 2193
慢半拍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:14

    Mysql 5.7.24 get root first login

    step 1: get password from log

     grep root@localhost /var/log/mysqld.log
        Output
            2019-01-17T09:58:34.459520Z 1 [Note] A temporary password is generated for root@localhost: wHkJHUxeR4)w
    

    step 2: login with him to mysql

    mysql -uroot -p'wHkJHUxeR4)w'
    

    step 3: you put new root password

    SET PASSWORD = PASSWORD('xxxxx');
    

    you get ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

    how fix it?

    run this SET GLOBAL validate_password_policy=LOW;

    Try Again SET PASSWORD = PASSWORD('xxxxx');

提交回复
热议问题