How to find out the MySQL root password

后端 未结 17 2517
野趣味
野趣味 2020-11-29 15:29

I cannot figure out my MySQL root password; how can I find this out? Is there any file where this password is stored?

I am following this link but I do not have dir

17条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 16:24

    Follow these steps to reset password in Windows system

    1. Stop Mysql service from task manager

    2. Create a text file and paste the below statement

    MySQL 5.7.5 and earlier:

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


    MySQL 5.7.6 and later:

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

    1. Save as mysql-init.txt and place it in 'C' drive.

    2. Open command prompt and paste the following

    C:\> mysqld --init-file=C:\\mysql-init.txt

提交回复
热议问题