安装jdk8等
mkdir /opt/jdk
cd /opt/jdk/
ls
tar -zxvf jdk(tab键)
ll
mkdir /usr/local/java
mv jdk1.8.0_261/ /usr/local/java/
ll
cd /usr/local/java/
ll
cd jdk1.8.0_261/
ls
cd bin/
ls
./java -version ./javac -version会弹出jdk1.8 如果切换到cd /home/目录在输入javac -version将不能用
目前环境变量有 echo $PATH
vim /etc/profile
在最后面增加export JAVA_HOME=/usr/local/java/jdk1.8.0_261和export PATH=$JAVA_HOME/bin:$PATH
source /etc/profile [让新的环境变量生效]
echo $PATH
javac
javac -version
vim Hello.java ll ls
javac Hello.java
java Hello
mysql安装
mkdir /opt/mysql
cd /opt/mysql/
上传
ls
解压 tar -xvf m(tab键)
ls
rpm -qa | grep mari 有的话删掉
rpm -e --nodeps mariadb-libs
rpm -qa | grep mari
rpm -qa | grep marisa
rpm -e --nodeps marisa
rpm -qa | grep mari 清干净了
ls
然后开始真正安装mysql,依次运行一下几条
rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.26-1.el7_x86_64.rpm
rpm -ivh mysql-community-server-5.7.26-1.el7.x86_64.rpm
7.运行 systemctl start mysqld-service,启动mysql
8.然后开始设置root用户密码
Mysql自动给root用户设置随机密码,运行grep "password"/var/log/mysqld.log可看到当前密码
9.运行mysql -u root -p,用root用户登录,提示输入密码可用上述的,可以成功登陆进入mysql命令行
10.设置root密码,对于个人开发环境,如果要设比较简单的密码(生产环境服务器要设复杂密码),
可以运行set global validate_password_policy=0;提示设置密码策略(validate_password_policy默认值1)
11.set password for 'root'@'localhost'=password("wqedu100");
12.运行flush privileges;是密码设置生效