法一:

格式:mysqladmin -u用户名 -p旧密码 password 新密码

 

方法二:
1.用root 进入mysql后
mysql>set password =password('你的密码');
mysql>flush privileges;


2.使用GRANT语句
mysql>grant all on *.* to 'root'@'localhost' IDENTIFIED BY '你的密码'with grant option ;
mysql>flush privileges;

3.进入mysql库修改user表
mysql>use mysql;
mysql>update user set password=password('你的密码') where user='root';
mysql>flush privileges;

相关文章:

  • 2021-05-11
  • 2021-04-02
  • 2022-12-23
  • 2022-12-23
  • 2021-09-02
  • 2021-11-03
  • 2021-11-03
猜你喜欢
  • 2021-09-13
  • 2021-12-22
  • 2021-12-26
  • 2022-12-23
  • 2022-01-31
  • 2021-11-19
  • 2021-11-13
相关资源
相似解决方案