shell读取mysql表中用户数据创建系统用户
分为2部分1 读取mysql的关于user的表并存到文件读取每一行并显示出来
2 读取每一行并添加用户出来
#show columns from 表名
#/bin/bash
mysql -uroot -ppasswordnamed.txt
use yao; #在database yao里有个用户表myuser
select username from myuser;
EOF
for name in `cat named.txt` #将每一行获取
do
useradd $name -p password #执行
done
页:
[1]