Turn off the firewall and set it to not start automatically after startup:

systemctl stop firewalld.service

systemctl disable firewalld.service

Installation and configuration of JDK in Linux system

Go to the opt directory: CD /opt

Upload the JDK file in opt: JDK-8u152-linux-x64.tar. gz

Decompress: tar -zxvf JK-8u152-linux-x64.tar. gz

Go to the etc directory: CD /etc

Backup: cp profile profile.bak

Modified: Vim Profile

Enter I at the end of the file and add the following configuration at the end:

JAVA_HOME=/opt/jdk1.8.0_152

PATH=$JAVA_HOME/bin:$PATH

export JAVA_HOME PATH
Copy the code

Then save and exit: press Esc+ : wq

Run the source /etc/profile or reboot script file for the configuration file to take effect

Check the JDK version: java-version

Java version "1.8.0_152" Java(TM) SE Runtime Environment (build 1.8.0_152-B16) Java HotSpot(TM) 64-bit Server VM (build 25.152 - b16, mixed mode)Copy the code

View: path Path: echo $path

/ opt/jdk1.8.0 _152 / bin: / opt/jdk1.8.0 _152 / bin: / usr/local/sbin, / usr/local/bin: / usr/sbin, / usr/bin: / root/binCopy the code

View the JAVA_HOME directory: echo $JAVA_HOME

/ opt/jdk1.8.0 _152Copy the code

Tomcat installation and configuration

Go to the opt directory: CD /opt

Upload apache-tomcat-8.5.24.tar

Decompress the package tar -zxvf apache-tomcat-8.5.24.tar.gz

To start tomcat, run /opt/apache-tomcat-8.5.24/bin/startup.sh

If an error occurs, go to the logs directory: CD /opt/apache-tomcat-8.5.24/logs

View logs: less Catalina.out

MySQL installation and configuration

Go to the opt directory: CD /opt

RPM and mysql-client-5.5.52-1.el6.x86_64. RPM are uploaded to the opt directory

RPM -e –nodeps mariadb-libs-1:5.5.56-2.el7.x86_64: RPM -e –nodeps mariadb-libs-1:5.5.56-2.el7.x86_64: RPM -e –nodeps mariadb-libs-1:5.5.56-2.el7.x86_64

Run the RPM -ivh /opt/ mysql-server-5.5.52-1.el6.x86_64. RPM command to install the server

To install a client, run the RPM -ivh /opt/ mysql-client-5.5.52-1.el6.x86_64. RPM command

Check the version: mysqladmin –version

Mysqladmin Ver 8.42 Distrib 5.5.52, for Linux on x86_64

Start the MySQL service: systemctl start mysql.service

Run the systemctl status mysql.service command to check the service status

View port: netstat anp | grep, 3306

See the mysql running process: ps – ef | grep mysql | grep -v grep

Set the root user and password: mysqladmin -u root password

New password:

Confirm new password:

Mysql -u root -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.5.52 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type ‘help; ‘ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>

Run the show databases command to view databases.

Use the test database: user test;

To view tables: show tables;

Exit: exit;

192.168.134.100, user name: root, password: root

If the connection fails, run the systemctl status firewalld.service command to check the firewall on Linux

Low firewalld. Service - firewalld - dynamic firewall daemon the Loaded: the Loaded (/ usr/lib/systemd/system/firewalld. Service; disabled; Vendor Preset: Enabled) Active: Inactive (dead) Docs: Man: Firewalld (1) 8月 12 07:32:47 Rich Systemd [1]: Starting firewalld - dynamic firewall daemon... 8月 12 07:32:47 Rich Systemd [1]: Started FirewallD-dynamic Firewall daemon. 8月 12 07:32:47 Rich Firewalld [721]: WARNING: ICMP type 'beyond-scope' is not supported by the kernel for ipv6. 8月 12 07:32:47 Rich Firewalld [721]: WARNING: Beyond -scope: INVALID_ICMPTYPE: No supported ICMP type., ignoring for run-time. 8月 12 07:32:47 Rich Firewalld [721]: WARNING: ICMP type 'failed-policy' is not supported by the kernel for ipv6. 8月 12 07:32:47 Rich Firewalld [721]: WARNING: failed-policy: INVALID_ICMPTYPE: No supported ICMP type., ignoring for run-time. 8月 12 07:32:47 Rich FireWALld [721]: WARNING: ICMP type 'rejection-route' is not supported by the kernel for ipv6. 8月 12 07:32:47 Rich Firewalld [721]: WARNING: Reject-route: INVALID_ICMPTYPE: No supported ICMP type., ignoring for run-time. 8月 12 09:30:57 Rich Systemd [1]: Stopping firewalld - dynamic firewall daemon... 8月 12 09:30:59 Rich Systemd [1]: Stopped Firewalld - Dynamic Firewall daemonCopy the code

Firewall down, no problem, mysql authorization problem

Mysql -u root -p

Run the show databases command to view databases.

Use mysql database: user mysql;

To view tables: show tables;

Select host,user,password from user;

Insert data into user table (password copy localhost password) : insert into user(host,user,password) values(‘%’,’root’,’81F5E21E35407D884A6CD4A731AEBFB6AF209E1B’);

GRANT ALL PRIVILEGES ON *.* TO ‘PRIVILEGES ‘@’%’ IDENTIFIED BY’root’ WITH GRANT OPTION;

Query OK, 0 rows affected (0.00 sec)
Copy the code

Mysql: exit mysql;

Run the following command to restart the mysql service: service mysql restart; Or systemctl restart mysql.service

Shutting down MySQL... SUCCESS! 
Starting MySQL.. SUCCESS! 
Copy the code

Go to Windows sqlYog connection, connection successful!