在mysql5.7以下的版本如下:
UPDATE user SET Password=PASSWORD('newpassword') where USER='root' and host='127.0.0.1' or host='localhost';

//把空的用户密码都修改成非空的密码就行了。

在mysql5.7版本如下:

UPDATE mysql.user set authentication_string=password('newpassword') where user='root' and host='127.0.0.1' or host='localhost';


GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH  GRANT OPTION;  

 FLUSH PRIVILEGES;

如果我的文章对你有帮助,就请博主喝杯咖啡吧

mysql 授权命令操作


相关文章:

  • 2021-06-05
  • 2021-05-16
  • 2022-12-23
  • 2022-01-07
  • 2021-08-06
  • 2021-12-16
  • 2021-04-13
猜你喜欢
  • 2022-12-23
  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2021-10-07
  • 2021-12-22
相关资源
相似解决方案