首页 > 代码库 > Password expiration policy in MySQL Server 5.7
Password expiration policy in MySQL Server 5.7
原理
http://www.tuicool.com/articles/N7fuea
批量脚本
mysql -uroot -p‘xx‘ -e "select user,host from mysql.user;">/root/user.txt sed -i ‘1d‘ user.txt #sed -i ‘s/[ ][ ]*/@/g‘ user.txt sed -i ‘s/\s\+/@/g‘ user.txt cat alter.sh #!/bin/bash for i in `cat user.txt` do name=`echo $i|awk -F ‘@‘ ‘{print $1}‘` ip=`echo $i|awk -F ‘@‘ ‘{print $2}‘` st="ALTER USER ‘"$name"‘@‘"$ip"‘ PASSWORD EXPIRE NEVER;" echo $st done select user,host,password_last_changed,password_lifetime,password_expired FROM mysql.user WHERE user = ‘xx‘\G flush privileges; cd /root && rm -rf user.txt
本文出自 “python 运维” 博客,谢绝转载!
Password expiration policy in MySQL Server 5.7
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。