MySQL root password change

前端 未结 22 2850
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 18:30

I have been trying to reset my MySQL root password. I have run the mysqld_safe --skip-grant-tables, updated the root password, and checked the user table to make sure it is

22条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 18:53

    For MySQL 5.7.6 and later:

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

    For MySQL 5.7.5 and earlier:

    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
    

提交回复
热议问题