This account is currently not available.
场景:
因是使用自动化脚本安装的MySQL,并且mysql用户创建也是自动创建,以前在centos6版本一直没有问题,
今天在centos7版本安装报错:
# su - mysql
Last login: Wed Apr 3 09:19:44 EDT 2019 on pts/0
This account is currently not available.
解决:
This account is currently not available.查看了一下说是该用户被禁用了shell
查看/etc/passwd文件里mysql的信息
# vipw /etc/passwd
或
# vipw
原信息:mysql:x:1001:1001::/home/mysql:/sbin /nologin
修改为:mysql:x:1001:1001::/home/mysql:/bin/bash
再次尝试切换mysql
# su - mysql
成功登陆,搞定!!!
本文解决了在CentOS7上使用自动化脚本安装MySQL后,mysql用户无法登录的问题。通过修改/etc/passwd文件中mysql用户的shell设置从/sbin/nologin到/bin/bash,成功解决了This account is currently not available错误。
3359

被折叠的 条评论
为什么被折叠?



