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

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

    On Ver 14.14 Distrib 5.7.19, for macos10.12 (x86_64), I logged in as: mysql -uroot -p then typed in the generated password by MySQL when you install it. Then..

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

    Example:

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Ab1234'; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye $ mysql -uroot -p

    And you can type in 'Ab1234'

提交回复
热议问题