mysql Forgot your password? You can set a new password in just ten steps!

  1. administratorRun cmd
    cd to the mysql installation folderbinUnder contents
    net stop mysql //停止数据库服务

  2. Manually delete the mysql installation folder data folder

  3. mysqld -remove MySQL //移除mysql服务

  4. mysqld -install //安装mysql
    Display Service successfully installed Configuration completed

  5. mysqld --initialize-insecure --user=mysql //不设置密码初始化
    No information shows the folder appears after completion data table of Contents

  6. net start mysql //启动服务

  7. mysql -u root -p //进入数据库
    Press Enter without entering the password

  8. alter user user() identified by " ";
    do not forgetsemicolon, Enter the set password in quotation marks

  9. quit //退出数据库

  10. mysql -u root -p
    Log in to the database again and enter the password you just set

Guess you like

Origin blog.csdn.net/weixin_46329969/article/details/109323200