Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed description of Linux installation of JDK, Tomcat and MySQL (illustrated with pictures and texts)

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will describe in detail how to install JDK, Tomcat and MySQL in Linux after installing a virtual machine on Windows. I hope it can help you.

First of all, these installations are running in xshell, what, no xshell? All right, I'll give you resources. After installation, there will be xshell inside, just open it and use it.

1. Install JDK

It is recommended to use the rpm package when installing. Rpm in Linux is equivalent to exe in Windows. There is no need to manually set environment variables using the installation method in this article.

Here to provide you with a copy of JDK-8 resources.

1.1 upload local JDK files to the server (Linux)

Many people will use xftp to drag directly into the Linux, although you can achieve the same effect, but this is a rookie approach, today to use another method, quite rough: typing the command.

Typing commands will rely on a piece of software, and later installation of software will give priority to the use of yum. Yum puts some popular Linux packages on some of the faster servers in China. It downloads the installation package in rpm format and installs it.

All right, let's install this software first, command: yum-y install lrzsz

Use the file upload command: rz-y

A dialog box will pop up and select the installation package for JDK.

1.2 get the rpm package

Use the command: yum-y install jdk-8u141-linux-x64.rpm

After a while, the installation can be successful, and this method does not require the configuration of environment variables. After installation, get into the habit of testing whether the environment variables work:

two。 Install Tomcat

2.1 Tomcat installation package is placed in Linux

You can use the command line, where you don't need a command to save trouble, and drag it directly to Linux using xftp (excuse me). Here is a copy of Tomcat's resources.

(all kinds of resources, what do you think? I'm not bad, )

It is recommended to put all the software you need to extract under the / data directory. If you do not have this directory, you can create the directory directly under the root directory and the command to create the directory: mkdir / data

Go to the / data directory and copy (cut) the compressed package of Tomcat to the / data directory:

2.2 decompress the compressed package of Tomcat

Use the command: tar-xzvf apache-tomcat-8.0.45.tar.gz

Where:

X: stands for release (decompression)

V: represents the process of showing decompression

Z: it means whether this is a compressed package or not. Generally speaking, it ends with gz representing a compressed package.

F: indicates recursive decompression

Of course, you can also choose to change the name of Tomcat, the command: mv (spaces here) apache-tomcat-8.0.45 (spaces here) tomcat_test_1

Start Tomcat: whether you write a relative path or an absolute path, specify to run startup.sh

2.3 check to see if Tomcat is started

Some people will wonder if Tomcat has been started. Don't you build it yourself? sometimes when the Tomcat port is occupied, the startup will fail.

Check whether the command is started: ps aux | grep tomcat

Then take a look at the Tomcat path and its port number, as shown in the red box above.

When your Tomcat is opened, when you ecstatically enter your virtual machine ip address and 8080 to access the three-legged cat (Tomcat icon) in the browser, you will find that the cat will not appear at dawn, not that the cat has been lost, but that it has been blocked by a great firewall on your computer's way.

So one more step, turn off the firewall.

2.4 disable the firewall

Command: service iptables stop

Then enter the ip address of the virtual machine plus 8080 in the browser to see the Tomcat logo:

3. Install the latest version of mysql 5.7

On MySQL's website, there is a link: A Quick Guide to Using the MySQL Yum Repository.

Now, according to this address, I will walk you through the installation process.

3.1Creating yum feeds

Create a yum source with any file name, but the official website recommends that you name it mysql-community.repo, so create a new file with the extension repo, and the file content is as follows:

[mysql57-community] name=MySQL 5.7 Community Serverbaseurl= http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/enabled=1gpgcheck=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Upload this file to / etc/yum.repos.d/.

Then use the command: yum search mysql, and you will find that there is an extra line at the bottom:

3.2 install mysql

Use the command: yum install mysql-community-server

3.3 restart mysql

Use the command: service mysqld restart

3.4 View login password

This password is a temporary password and can only be used once. Log in to the mysql client using the changed password.

3.5 Log in to mysql client

Use the command: mysql-u root-p

After the successful login, the first thing of course is to change the password, .

The official website provides the command to change the password:

ALTER USER 'root'@'localhost' IDENTIFIED BY' MyNewPass4passport'

However, this password is also very difficult to remember, if you want to change it to a simple password, such as MyNewPass4! Change to 123456, such a password is easy to remember, and then you will find that it does not allow you to change it, because it is too simple to meet its naming rules.

So, first of all, log in to MySQL successfully according to the command provided on the official website above, and then uninstall the plug-in for mysql password:

Uninstall plugin validate_password

Then change the password:

ALTER USER 'root'@'localhost' IDENTIFIED BY' 123456'

Type exit to exit the client and log in with the new password.

The default account is used locally, and different computers are not allowed to use. For example, you cannot use Navicat to connect to the MySQL database in Windows.

How can I do it? Re-create an account to allow remote links, with the following command:

The copy code is as follows: grant all privileges on *. * to 'root'@'%'identified by' 123456 'with grant option

Then use Navicat under Windows to connect to the database.

3.6 modify the default encoding

Using Navicat, you can connect to the database after the default encoding format is Latin, so change the default encoding format.

When you modify the configuration file / etc/my.cnf, and then change the file, get into the habit of backing up a copy before you modify it.

Use vi / etc/my.cnf, then find mysqld and add a line

Character_set_server=utf8

Then restart the mysql service, using the command: service mysqld restart

The above is the detailed installation process hope to help you, welcome to collect and pay attention.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report