一、java的安装
1.首先查看是否已安装
[root@localhost ~]# java -version
2.自带jdk
rpm -qa |grep java
rpm -qa |grep jdk
rpm -qa |grep gcj
3.卸载系统自带
rpm -qa | grep java | xargs rpm -e --nodeps
4.卸载yum安装
yum -y remove java-1.8.0-openjdk-headless.x86_64
5.安装jdk
yum list java-1.8*
yum install java-1.8.0-openjdk* -y
验证:java -version
二、mysql的安装
1.下载
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
2.安装
yum -y install mysql57-community-release-el7-10.noarch.rpm
3.安装服务
yum -y install mysql-community-server
4.启动mysql
systemctl start mysqld.service
5.查看运行状态
systemctl status mysqld.service
6.mysql的root密码
grep "password" /var/log/mysqld.log
7.进入mysql
mysql -uroot -p
8.修改mysqlroot密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
9.下载yum自动更新mysql
yum -y remove mysql57-community-release-el7-10.noarch
三、直接安装jre
1.下载:百度java,在官网下载rpm包
2.进入文件路径执行:yum localinstall jre-8u301-linux-x64.rpm
localinstall安装命令