mysqladmin: unable to change password; error: ‘Your password does not satisf

10 篇文章 0 订阅

装完mysql启动服务,第一次使用需要重置密码,显示我输入的密码"123456"太简单,在个人练习过程中,不想把密码设置太复杂

# grep password /var/log/mysql.log

2022-01-02T05:03:18.625427Z 1 [Note] A temporary password is generated for root@localhost: )Vl+vhJE%9yj

# mysqladmin -uroot -p")Vl+vhJE%9yj" password "123456"
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
mysqladmin: unable to change password; error: 'Your password does not satisfy the current policy requirements'

解决方案:

# mysql -uroot -p')Vl+vhJE%9yj'

(1)修改validate_password_policy参数值为0(1为开启复杂策略)

注意:此参数(policy)必须优先修改,因为policy策略不修改为0会影响下面的length参数。

mysql> set global validate_password_policy=0;

(2)修改validate_password_length参数值为1

mysql> set global validate_password_length=1;

退出重新修改密码

mysql > exit;

# mysqladmin -uroot -p')Vl+vhJE%9yj' password

输入密码: 123456

确认密码: 123456

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值