1.  将安装目录下的my-defult.ini文件名改为my.ini后剪切到bin目录下

开启mysql服务

2.  cmd进入到MySQL安装目录的bin目录下,输入:

mysqld --initialize --user=mysql --console

开启mysql服务

记录这里出现的临时密码,之后登录时会用到

注:这一步如果出现问题,进入mysql安装目录下的data目录,把里面的内容全部删除,再进行这一步

3.  安装服务:mysqld –install

开启mysql服务

4.  开启服务:net start mysql

开启mysql服务

5.  登录:mysql -u root -p

输入密码时就输第一步产生的临时密码

开启mysql服务

6.  修改密码:set password for [email protected]=password('123456');

123456处就是你的新密码

开启mysql服务

7.  退出:quit

8.  用新密码登录:mysql -u root -p

开启mysql服务

相关文章:

  • 2021-07-10
  • 2021-08-17
  • 2021-09-22
  • 2022-01-21
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-20
  • 2021-04-30
  • 2021-11-26
  • 2022-02-08
  • 2022-12-23
  • 2021-11-20
相关资源
相似解决方案