CentOS 7.3离线安装 JDK,Mariadb

1.环境准备

#链接:https://pan.baidu.com/s/1rcLrELaLHBJI0pKQQFOnNA 
#提取码:f1a2

2.安装

# 离线文件位置
/home/bw/# 将目标机器系统自带的仓库文件,转移备份

# mkdir /etc/yum.repos.d/backup
# mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup
# yum clean all

rpm -qa | grep libxml2 | xargs rpm -e --nodeps
rpm -qa | grep deltarpm| xargs rpm -e --nodeps
rpm -ivh  deltarpm-3.6-3.el7.x86_64.rpm
rpm -ivh  python-deltarpm-3.6-3.el7.x86_64.rpm
rpm -ivh  libxml2-2.9.1-6.el7.4.x86_64.rpm
rpm -ivh  libxml2-python-2.9.1-6.el7.4.x86_64.rpm
# mkdir -p /var/ftp/pub/localrepo # cp -f /home/bw/repo/* /var/ftp/pub/localrepo # touch /etc/yum.repos.d/localrepo.repo #echo "[localrepo]" >>/etc/yum.repos.d/localrepo.repo #echo "name=Local Repository" >>/etc/yum.repos.d/localrepo.repo #echo "baseurl=file:///var/ftp/pub/localrepo" >>/etc/yum.repos.d/localrepo.repo #echo "gpgcheck=0" >>/etc/yum.repos.d/localrepo.repo #echo "enabled=1" >>/etc/yum.repos.d/localrepo.repo #createrepo -v /var/ftp/pub/localrepo yum repolist yum -y install MariaDB-server MariaDB-client MariaDB-common MariaDB-compat # 查看yum进程,有的话删除 ps aux|grep yum kill -s 9 25960 # rm -rf /var/ftp/pub/localrepo # rm -rf /etc/yum.repos.d/localrepo.repo # mv /etc/yum.repos.d/backup/*.repo /etc/yum.repos.d/ # rm -rf /etc/yum.repos.d/backup # yum clean all # 设置mariadb开机启动 systemctl start mariadb systemctl list-unit-files | grep mariadb systemctl enable mariadb # 设置root帐号密码 mysqladmin -u root password 1111 mysql -u root >create database iasm; # 登录数据库,开启远程访问权限 mysql -uroot -p123456 grant all privileges on *.* to 'root'@'%' identified by '1111' with grant option; flush privileges; exit mysql -u root -p iasm < /home/bw/repo/iasm.dump # 关闭防火墙 systemctl stop firewalld systemctl disable firewalld
# 卸载自带的Java环境,详情参见https://www.cnblogs.com/daofaziran/p/13125412.html
cd
/home/bw/Downloads rpm -e --nodeps java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64 rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64 # 解压jdk环境 tar -xzvf ./jdk-8u241-linux-x64.tar.gz mv -f jdk1.8.0_241 /usr/local/jdk1.8.0_241 vim /etc/profile #java environment export JAVA_HOME=/usr/local/jdk1.8.0_241 export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar export PATH=$PATH:${JAVA_HOME}/bin # 重新加载配置文件 source /etc/profile

 

posted @ 2020-06-17 15:47  老虎死了还有狼  阅读(261)  评论(0编辑  收藏  举报