MySQL root password change

前端 未结 22 2862
被撕碎了的回忆
被撕碎了的回忆 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:48

    have a look at this from MySQL Reference manual:

    First login mysql:

    # mysql -u root -p
    

    Then at mysql prompt run:

    UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
    

    Then

    FLUSH PRIVILEGES;
    

    Look at this page for more information: Resetting the Root Password: Unix Systems

提交回复
热议问题