Linux部署Java环境
一. yum安装jdk
(1)
搜索jdk安装包
yum search java|grep jdk
(2)
下载jdk1.8,下载之后默认的目录为: /usr/lib/jvm/
yum install java-1.8.0-openjdk
(3) 输入 java -version 看是否安装成功
二 安装tomcat
(1) 下载安装tomcat(http://tomcat.apache.org/)我这边是下载的apache-tomcat-8.0.50.tar.gz
(2)
解压tar -zxvf apache-tomcat-8.0.50.tar.gz
(3) 创建目录Tomcat 复制到tomcat目录 mkdir /usr/local/tomcat mv apache-tomcat-8.0.50 /usr/local/tomcat/
(4) 启动 ./startup.sh
三 安装mysql
(1) 安装YUM Repo wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
(2) 然后进行repo的安装: rpm -ivh mysql57-community-release-el7-9.noarch.rpm
(3) 安装MySQL
yum install mysql-server
systemctl start mysqld #启动MySQL
配置MySQL
获取安装时的临时密码:
grep 'temporary password' /var/log/mysqld.log
登录:
mysql -u root -p
登录成功后修改密码:set password=password("yourpassword");
修改权限 标示任何主机能连接
update user set host = '%' where user = 'root';
使用此命令可以让mysql 设置8位简单命令
set global validate_password_policy=0;