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
成功登陆,搞定!!!