Linux系统:Centos7下安装Jdk8、Tomcat8、MySQL5.7环境

Linux系统:Centos7下安装Jdk8、Tomcat8、MySQL5.7环境,第1张

概述本文源码: GitHub·点这里 || GitEE·点这里 一、JDK1.8 环境搭建 1、上传文件解压 [[email protected] mysoft]# tar -zxvf jdk-8u161-linux-x64.tar.gz[[email protected] mysoft]# pwd/usr/local/mysoft[[email protected] mysoft]# mv j 本文源码: GitHub·点这里 || GitEE·点这里

一、JDK1.8 环境搭建 1、上传文件解压
[[email protected] mysoft]# tar -zxvf jdk-8u161-linux-x64.tar.gz[[email protected] mysoft]# pwd/usr/local/mysoft[[email protected] mysoft]# mv jdk1.8.0_161 jdk1.8
2、检查环境,已经安装删除
[[email protected] mysoft]# ps -aux|grep java[[email protected] mysoft]# rpm -e --nodeps rpm -qa | grep java
3、配置环境变量
[[email protected] /]# vim /etc/profile# 文件末尾追加 下面内容 shit+g 跳到文件末尾# JAVA_HOMEexport JAVA_HOME=/usr/local/mysoft/jdk1.8export PATH=$PATH:$JAVA_HOME/bin
4、检测安装成功
[[email protected] /]# java -versionopenjdk version "1.8.0_161"OpenJDK Runtime Environment (build 1.8.0_161-b14)OpenJDK 64-Bit Server VM (build 25.161-b14,mixed mode)
二、TOMCAT8 安装 1、上传安装包
[[email protected] mysoft]# tar -zxvf apache-tomcat-8.5.40.tar.gz[[email protected] mysoft]# mv apache-tomcat-8.5.40 tomcat8.5
2、启动服务
[[email protected] bin]# pwd/usr/local/mysoft/tomcat8.5/bin[[email protected] bin]# ./startup.sh Tomcat started.
3、访问测试
http://127.0.0.1:8080/ OK了
三、MysqL5.7 安装 1、卸载原系统中的mariadb
[[email protected] /]# rpm -qa|grep mariadbmariadb-libs-5.5.56-2.el7.x86_64[[email protected] /]# rpm -e --nodeps mariadb-libs[[email protected] /]# rpm -qa|grep mariadb
2、获取官方地址

地址:https://dev.MysqL.com/downloads/repo/yum/https://dev.MysqL.com/get/MysqL80-community-release-el7-3.noarch.rpm
3、Yum源安装
wget https://dev.MysqL.com/get/MysqL80-community-release-el7-3.noarch.rpm[[email protected] /]# rpm -ivh MysqL80-community-release-el7-3.noarch.rpm[[email protected] /]# yum repoList all|grep MysqLMysqL57-community/x86_64 MysqL 5.7 Community Server DisabledMysqL80-community/x86_64 MysqL 8.0 Community Server enabled: 113MysqL80-community-source MysqL 8.0 Community Server - Disabled……..

yum源中默认启用的安装包版本为MysqL8.0,这里切换为5.7,执行以下命令;

[[email protected] /]# yum-config-manager --disable MysqL80-community[[email protected] /]# yum-config-manager --enable MysqL57-community

4、MysqL 安装启动
[[email protected] /]# yum install MysqL-community-server# 需要安装依赖提示,选择yTotal download size: 192 MInstalled size: 865 MIs this ok [y/d/N]: y

查看版本

[[email protected] /]# MysqL -VMysqL Ver 14.14 distrib 5.7.26,for linux (x86_64) using Editline wrapper

启动查看状态

[[email protected] /]# systemctl start MysqLd.service[[email protected] /]# systemctl status MysqLd.service     MysqLd.service - MysqL Server Loaded: loaded (/usr/lib/systemd/system/MysqLd.service; enabled; vendor preset: Disabled) Active: active (running) since Tue 2019-05-14 17:26:32 CST; 31s ago

为root账户生成临时密码

[[email protected] /]# grep ‘temporary password‘ /var/log/MysqLd.log2019-05-14T09:26:28.657250Z 1 [Note] A temporary password is generated for [email protected]: !Bh(GT.od9L;

设置root用户密码

# 这里防止出现密码策略,强度不够的问题MysqL> set global valIDate_password_policy=LOW;MysqL> alter user ‘root‘@‘localhost‘ IDentifIEd by ‘husky123456‘;

这样,Java的基础环境就搭建完毕了!

四、源代码地址
GitHub·地址https://github.com/cicadasmile/linux-system-baseGitEE·地址https://gitee.com/cicadasmile/linux-system-base

总结

以上是内存溢出为你收集整理的Linux系统:Centos7下安装Jdk8、Tomcat8、MySQL5.7环境全部内容,希望文章能够帮你解决Linux系统:Centos7下安装Jdk8、Tomcat8、MySQL5.7环境所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1023416.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存