Resetting ROOT password in MySQL 5.6

前端 未结 9 1946
名媛妹妹
名媛妹妹 2020-11-27 17:24

I have been following these instructions for resetting root password for local installation of MySQL 5.6 on Windows 7 laptop.

I stopped

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 17:32

    Updating this answer regarding to changes at MySQL 5.7:

    0) shut down service mysql57

    1) go to C:\ProgramData\MySQL\MySQL Server 5.7, note that ProgramData is a hidden folder

    2) looking for file my.ini, open it and add one line skip-grant-tables below [mysqld],save

    [mysqld]
    
    skip-grant-tables
    

    3) start service mysql57

    4) by right, you can access the database, run mysql

    5) and use the query below to update the password

    update mysql.user set authentication_string=password('NEW_PASSWORD') where user='root';

    6) shut down the service again, remove the line skip-grant-tables save it, and start the service again. try to use the password you set to login.

提交回复
热议问题