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

Detailed explanation of MySQL monitoring tool mysql-monitor

1. Overview mysql-monitor MYSQL monitoring tool, ...

How to solve "Unable to start mysql service error 1069"

Today, when I was on the road, a colleague sent m...

Detailed explanation of several methods of installing software in Linux

1. RPM package installation steps: 1. Find the co...

Detailed tutorial on how to delete Linux users using userdel command

What is serdel userdel is a low-level tool for de...

Linux's fastest text search tool ripgrep (the best alternative to grep)

Preface Speaking of text search tools, everyone m...

Summary of Linux user groups and permissions

User Groups In Linux, every user must belong to a...

An article to solve the echarts map carousel highlight

Table of contents Preface toDoList just do it Pre...

Solve the problem of mysql data loss when docker restarts redis

Official documentation: So mysql should be starte...

Vue3.0 routing automatic import method example

1. Prerequisites We use the require.context metho...

How InnoDB implements serialization isolation level

Serialization implementation InnoDB implements se...

MySQL Series 7 MySQL Storage Engine

1. MyISAM storage engine shortcoming: No support ...

Description of the hr tag in various browsers

Generally, we rarely meet HR, but once we do, it c...

How to operate MySQL database with ORM model framework

What is ORM? ORM stands for Object Relational Map...