#! /bin/bash
#####################ECS Type Deploy###############
#mail:ratelcloud@foxmail.com
#system:centos7.x
#integration: RatelBoot-EvInit
#####################aliyun yum source
echo "###############Init Yum Source Start....."
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
echo "###############Init Yum Source End....."
#####################MySQL80Server
echo "###############Install MySQL80 Start....."
wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
yum install -y mysql-community-server
yum install -y mysql-community-server --nogpgcheck
echo ">>>>>>install success"
systemctl start mysqld
systemctl enable mysqld
systemctl status mysqld
grep 'temporary password' /var/log/mysqld.log
TEMP_PWD=$(grep 'temporary password' /var/log/mysqld.log)
PWD=${TEMP_PWD##* }
echo ">>>>>>mysql80 default password:${PWD}"
mysql -uroot -p${PWD}
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Zw9vaI@FjdsS4a#%u2AzkTrhp4';
exit
mysql -uroot -p'Zw9vaI@FjdsS4a#%u2AzkTrhp4'
echo ">>>>>>mysql login success..."
# use mysql;
# source /home/init.sql;
exit
echo "##############Install MySQL80 End....."
###################ECS Type Deploy##############
mysql一键安装自动安装脚本
原创
©著作权归作者所有:来自51CTO博客作者蜜獾互联网的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:Docker ELK 安装脚本
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章