标签:推送 enforce lld ORC grep mysql5.7 密码 wget project
[root@tianyun project]# vim mysql_install_1.sh
#! /usr/bin/env bash
# mysql install 1
# by tianyun
while read line
do
{
#yum 配置yum源
ssh root@$ip “rm –rf /etc/yum.repos.d/*”
ssh root@$ip “wget ftp://172.16.8.100/yumrepo/centos7.repo -P /etc/yum.repos.d/”
ssh root@$ip “wget ftp://172.16.8.100/yumrepo/mysql57.repo -P /etc/yum.repos.d/”
ssh root@$ip “yum –y install lftp vim-enhanced bash-completion”
#scp –r centos7.repo root@$ip:/etc/yum.repos.d/
#关闭防火墙和selinux
#Firewalld & SElinux
ssh root@$ip “systemctl stop firewalld”
“systemctl disabled firewalld”
ssh root@$ip “setenforce 0”
“sed –ri ‘/^SELINUX/c\SELINUX=disabled’ /etc/selinux/config”
#设置时钟
#ntp
ssh root@$ip “yum –y install chrony”
ssh root@$ip “sed –ri ‘/3.centos/a\server 172.16.8.100 iburst’ /etc/chrony.conf”
#启动时钟服务
#ssh root@$ip “systemctl start chronyd”
“systemctl enable chronyd”
#install mysql5.7
ssh root@$ip “yum –y install mysql-community-server”
#启动mysql
ssh root@$ip “systemctl start mysqld”
“systemctl enable mysqld”
ssh root@$ip “grep ‘temporary password’ /var/log/mysqld.log | awk ‘{print \$NF}’ > /root/mysqloldpass.txt”
#改mysql的初始密码
ssh root@$ip “mysqladmin –uroot –p’`cat /root/mysqloldpass.txt`’ password ‘(TianYunYang123)’ ”
}&
done < ip.txt
wait
echo “all finish…”
标签:推送 enforce lld ORC grep mysql5.7 密码 wget project
原文地址:https://www.cnblogs.com/momenglin/p/10327512.html