赞
踩
yum list java*
yum -y install java-1.8.0-openjdk.x86_64
java -version
无需配置java环境变量,但你不能直接javac,可能会导致部分依赖此命令的中间件无法运行,如nacos,maven
华为云仓库:https://repo.huaweicloud.com/java/jdk/
下载jdk8(64位)
wget -i -c https://repo.huaweicloud.com/java/jdk/8u202-b08/jdk-8u202-linux-x64.tar.gz
tar -xvf jdk-8u202-linux-x64.tar.gz
下载maven
wget -i -c https://repo.huaweicloud.com/apache/maven/maven-3/3.8.3/binaries/apache-maven-3.8.3-bin.tar.gz
tar -xvf apache-maven-3.8.3-bin.tar.gz
- 1.编辑环境变量
- nano /etc/profile
-
- 2.
- # 配置java环境变量(yum安装的jdk没有javac)
- export JAVA_HOME=/root/jdk1.8.0_202
- export PATH=$PATH:$JAVA_HOME/bin
-
- 3.
- # 配置maven环境变量
- export MVN_HOME=/root/apache-maven-3.8.3
- export PATH=$PATH:$MVN_HOME/bin
-
- 4.立即生效
- . /etc/profile
wget -i -c https://mirror.bit.edu.cn/apache/tomcat/tomcat-9/v9.0.38/bin/apache-tomcat-9.0.38.zip
yum install -y unzip zip
unzip apache-tomcat-9.0.38.zip
cd apache-tomcat-9.0.38/bin
chmod u+x *.sh
你也可以本地下载好tomcat再上传到服务器上
yum -y install mysql-community-server.x86_64
1.先下载mysql57的rpm:
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
wget -i -c https://dev.mysql.com/get/mysql80-community-release-el7-7.noarch.rpm
2.然后安装该rpm:
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql80-community-release-el7-7.noarch.rpm
3.最后安装mysql57:
yum -y install mysql-community-server
①查看MySQL运行状态
systemctl status mysqld
②启动MySQL
systemctl start mysqld
③找出初始密码
grep "password" /var/log/mysqld.log
④修改密码
先用初始密码登录:mysql -uroot -p 初始密码
再修改密码:
5.7
alter user 'root'@'localhost' identified by '密码';
8+
修改配置文件 nano /etc/my.cnf
开启无密码访问 skip-grant-tables
重启服务 systemctl restart mysqld
登录 mysql -uroot
刷新权限 flush privileges;
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY "密码";
(密码需要符号+大写字母+小写字母+数字+长度)
关闭无密码访问 skip-grant-tables
重启服务 systemctl restart mysqld
⑤开启mysql的远程访问
grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;
或
- use mysql;
-
- update user set host = '%' where user = 'root';
⑥重启mysql
systemctl restart mysqld
⑦关闭防火墙(也许本来就没有该服务)
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
一般到这里就结束了,下面是可配置项:
修改密码策略
vim /etc/my.cnf
[mysqld]下添加:
#使密码策略无效(默认要数字密码等组合)
validate_password_policy=0
#关闭验证密码
validate_password = off
#忽略表名大小写
lower_case_table_names=1
#修改端口号
port=3307
#无需密码登录
mysql5.7.31:添加skip-grant-tables,重启后输入mysql即可免密登录
mysql5.1.73:添加validate_password = off,重启后输入mysql即可免密登录,但修改完密码后需要validate_password = on否则无法使密码生效
请看我的另一篇博文:
centos安装redis_风流倜傥唐伯虎的博客-CSDN博客
需要先配置java环境和maven环境才能启动nacos
wget -i -c https://hub.fastgit.org/alibaba/nacos/releases/download/2.0.3/nacos-server-2.0.3.tar.gz
tar -xvf nacos-server-2.0.3.tar.gz
cd nacos/bin
nano startup.sh
standalone模式下修改-Xms为256m -Xmn为256m -Xmn为128m
sh startup.sh -m standalone
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。