mysql一键安装自动安装脚本
【代码】mysql一键安装自动安装脚本。
·
#! /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##############

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐
所有评论(0)