Install and deploy java8 and mysql under centos7

Install and deploy java8 and mysql under centos7

Generally, learning Java and deploying projects are done locally, but the production environment is generally in a Linux environment. The deployment and installation environment are all operated under the console. There is no visual operation interface of Windows. It is a challenge for novices to master and operate Linux commands. I recorded my installation and configuration process so that I can learn with everyone:

Log in to the remote server. For personal use, I use root and enter my password.

ssh -i ~/.ssh/id_rsa root@ip

Install Java 8

My server has yum, so most things are installed using yum, which is similar to homebrew on mac os. The installation and configuration are relatively simple.

First, let's see what versions of Java are available in yum:

yum -y list java*

After that, you can see a series of java1.6, 1.7, and 1.8. You can choose the version you want to install. I installed 1.8:

yum -y install java-1.8.0-openjdk*

It goes smoothly all the way and you will be prompted with completion!

Next, verify the Java version to see if the installation is complete:

java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)

OK, at this time our java8 is basically installed successfully! Next, install our mysql:

mysql installation

First download the installation package. This process depends on the network speed of your server:

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

Then install the mysql package:

sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm

Once that's done you can install mysql:

sudo yum install mysql-server

Along the way, I will do whatever I need to do.

I followed the online tutorial and got lost. I thought the installation was complete.

To start the service:

service mysqld start

I am ready to use mysql -u root -p to change the password. Haha, where is the initial password? OK, the online tutorial said that the log contains:

grep "password" /var/log/mysqld.log

But I really didn’t notice it!

what to do?

Modify in safe mode:

mysqld_safe --skip-grant-tables &

Next, we continue with mysql -u root -p and press Enter without entering a password! Change Password

1. Change password

 update mysql.user set authentication_string=password('your password') where user='root' and Host = 'localhost';

2. Refresh permissions

  flush privileges;

3. Exit

  quit

After exiting, restart the mysql service:

service mysqld restart

Then again

mysql -u root -p

Just enter the password you set and you can enter!

Redis, zookeeper, tomcat, etc. may be installed later

The above is what I introduced to you about installing and deploying Java 8 and MySQL under CentOS 7. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Detailed explanation of docker image centos7 configuration Java runtime environment
  • Tutorial on setting up Java environment under CentOS7
  • Analysis of the problem that centos7 firewall causes java program to report errors when accessing mongodb3.0.1
  • Tips for installing java and configuring environment variables under centos7
  • Tutorial on installing and updating JAVA8 on Linux operating system
  • Linux learning second Java environment installation and configuration tutorial
  • Linux server configuration and installation of Java and Tomcat server tutorial detailed explanation
  • Detailed steps for installing Java and configuring environment variables in Linux CentOS 7.0

<<:  Detailed explanation of vite2.0+vue3 mobile project

>>:  How to view the type of mounted file system in Linux

Recommend

HTML tag full name and function introduction

Alphabetical DTD: Indicates in which XHTML 1.0 DT...

MyBatis dynamic SQL comprehensive explanation

Table of contents Preface Dynamic SQL 1. Take a l...

Detailed tutorial on installing nvidia driver + CUDA + cuDNN in Ubuntu 16.04

Preparation 1. Check whether the GPU supports CUD...

How to fix the width of table in ie8 and chrome

When the above settings are used in IE8 and Chrome...

HTML basics - CSS style sheets, style attributes, format and layout details

1. position : fixed Locked position (relative to ...

The use of FrameLayout in six layouts

Preface In the last issue, we explained LinearLay...

Collection of 25 fonts used in famous website logos

This article collects the fonts used in the logos...

Two ways to reset the root password of MySQL database using lnmp

The first method: Use Junge's one-click scrip...

Idea configures tomcat to start a web project graphic tutorial

Configure tomcat 1. Click run configuration 2. Se...

A collection of common uses of HTML meta tags

What is a mata tag The <meta> element provi...

Solution to changing the data storage location of the database in MySQL 5.7

As the data stored in the MySQL database graduall...

Tutorial on installing MySQL8 compressed package version on Win10

1 Download MySQL8 from the official website and i...

How to connect Django 2.2 to MySQL database

1. The error information reported when running th...