mysql8 密码权限

作者: dreamfly 分类: mysql 发布时间: 2021-05-03 11:25

mysql8 版本对密码体系进行了改动,原来的验证体系是mysql_native_password,而最新的密码加密体系是caching_sha2_password.

此外,mysql对于密码的修改也做了变更,现在如果忘记root密码,可以通过一个初始化文件进行重置。

  1. 停止mysql服务
  2. 创建一个文件,文件内容如下:
    ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
  3. 使用init-file命令加载初始化文件
mysqld --init-file=/home/me/mysql-init &

当然,如果我们记得root密码,那么我们可以像原来一样修改密码

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

除此之外,我们还可以使用下面的命令来重置密码。

mysql -uroot -p oldpassword newpassword

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

9条评论
  • ValfKeeli

    2022年7月28日 11:12

    Buy Tretinoin Cream 0.025 cialis otc Comprar Cialis Tadalafil

  • Obedoms

    2022年8月17日 06:27

    buy stromectol ivermectin Viagra Rezeptfrei Cialis

  • JememaNut

    2022年9月2日 10:21

    Sildenafil, which is the active ingredient in both medications, belongs to a class of drugs called phosphodiesterase-5 inhibitors, or PDE5 inhibitors buy cialis online from india And here, something was going on where they separated those who were fit to work from those who, as it were, were unfit for work

  • Whereinue

    2022年9月4日 15:28

    priligy and viagra combination Is ED medication affected by food

  • poesque

    2022年9月6日 13:54

    BMA enables us to consider a large number of potential explanatory variables and sort out which of these variable can effectively explain Africa s growth experience buy cialis

  • Cetinsini

    2022年9月8日 22:23

    Concomitant Use of Potent Inhibitors of Cytochrome P450 3A4 CYP3A4 For patients taking potent inhibitors of CYP3A4 such as ritonavir, ketoconazole, and itraconazole, the dose of tadalafil tablets should be limited to 10 mg no more than once every 72 hours cialis and viagra sales Vascular, neurologic, psychologic, and hormonal disorders and sometimes drug use can compromise achievement of satisfactory erections

  • ancenbren

    2022年9月11日 14:26

    clomid and pcos Below is a short list of the most common 4.

  • Dewannope

    2022年9月18日 08:14

    The main route of pramipexole elimination, with 90 of a pramipexole dose found in the urine, almost entirely as unchanged drug Label. doxycycline dogs

发表评论

您的电子邮箱地址不会被公开。