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

Parse CSS to extract image theme color function (tips)

background It all started when a classmate in the...

The magic of tbody tag speeds up the display of table content

You must have saved other people’s web pages and l...

How to configure multiple projects with the same domain name in Nginx

There are two ways to configure multiple projects...

Detailed explanation of simple snow effect example using JS

Table of contents Preface Main implementation cod...

Sharing of experience on repairing MySQL innodb exceptions

A set of MySQL libraries for testing. The previou...

Share the 15 best HTML/CSS design and development frameworks

Professional web design is complex and time-consu...

Docker custom network implementation

Table of contents 1. Customize the network to rea...

How to read the regional information of IP using Nginx and GeoIP module

Install GeoIP on Linux yum install nginx-module-g...

Discuss the value of Web standards from four aspects with a mind map

I have roughly listed some values ​​to stimulate ...

Does the % in the newly created MySQL user include localhost?

Normal explanation % means any client can connect...

js realizes the magnifying glass function of shopping website

This article shares the specific code of js to re...

How to implement page screenshot function in JS

"Page screenshot" is a requirement ofte...

JavaScript to achieve dynamic color change of table

This article shares the specific code for JavaScr...