Detailed graphic explanation of installing MySQL database and configuring Java project on Linux

Detailed graphic explanation of installing MySQL database and configuring Java project on Linux

1. Install MySQL database

① Download and unzip and upload to the /opt/soft directory (the soft directory is created by yourself)

②Unzip: tar -xvf mysql-5.7.27-1.el7.x86_64.rpm-bundle.tar

③Clear the database that comes with Linux

1. Check if there is an old version of the database:

rpm -qa |grep mysql

rpm -qa | grep mariadb

2. Uninstall the existing database: (Uninstalling will also uninstall the dependent packages of this package)

yum -y remove mariadb-libs.x86_64

④Install MySQL community edition service package:

rpm -ivh mysql-community-server-5.7.27-1.el7.x86_64.rpm

It is found that 5 dependent packages are needed, so install the dependent packages first (needed dependencies)

1. Install perl's dependency packages:

yum -y install perl (here 27 packages with perl are installed, including 3 dependent packages)

2. Install the dependency package of mysql-community-client:

rpm -ivf mysql-community-client-5.7.27-1.el7.x86_64.rpm

It is found that this package depends on: mysql-community-libs, so install the mysql-community-libs package first.

Install the mysql-community-libs library package:

rpm -ivf mysql-community-libs-5.7.27-1.el7.x86_64.rpm

3. Install mysql-community-cient-5.7.27-1.el7.x86_64.rpm

4. Install the dependency package of mysql-community-common:

rpm -ivf mysql-community-common-5.7.27-1.el7.x86_64.rpm

⑤Install the MySQL community edition server package again:

rpm -ivh mysql-community-server-5.7.27-1.el7.x86_64.rpm

⑥Verify whether MySQL is installed successfully (if there is no error when starting, it means the installation is successful)

Start the mysql service: systemctl start mysqld.service

2. Find the temporary password and modify it

①Find the file that stores the temporary password:

find / -name mysql*log

②View temporary password:

more /var/log/mysql.log | grep temp

(The password is C_XMoVU7jjcW)

③ Enter mysql -u root -p and the temporary password to log in and enter the mysql database environment

④In the mysql database environment:

1. Set mysql password policy:

mysql>set global validate_password_policy=0;

2. Set the length of the mysql password:

mysql>set global validate_password_length=4;

3. Set password:

mysql>set password=password('123456');

4. Exit: quit; or ctrl+z

3. View and create remote connection users

① Check whether the user can connect remotely:

1. Log in: mysql -u root -p; enter the password to log in (123456)

2. Enter: use mysql;

3. View: select host,user,authentication_string from user;

②Create a remote user

1. Create a user: create user 'myroot'@'%' identified by '123456';

2. Grant permissions: grant all privileges on *.* to 'myroot'@'%';

3. Refresh: flush privileges;

4. Use Navicat tool to log in remotely

① Turn off the firewall: systemctl stop firewalld.service

② Make a connection

③Connection successful

5. Configure the Java project

The project contains: program package (.war) + data package (.sql)

①Upload the .war and program packages to the wbapps directory under tomcat (in the /opt/soft/apach-tomcat-8.5.47 directory)

② Import the .sql data package into Navicat (after connecting, left-click, and then click Run SQL File)

③Start the tomcat service: (Start in the bin directory under the apache-tomcat-8.5.47 directory)

sh startup.sh

④Modify the file that connects the project to the database so that the project can connect to the database

Default path: (The project will be automatically decompressed after uploading, refresh it first)

/opt/sotp/apache-tomcat-8.5.47/webapps/test/WEB-INF/classes

Revise:

1. Database service IP address: (Change to Linux IP address)

2. Database name: (Change to the project database name)

3. Username of the remote connection user: (username myroot)

4. Password of the remote connection user: (password of user myroot)

5. Save

⑥ Turn off the firewall:

systemctl stop firewalld.service

⑦Open the web page: enter 192.168.1.181:8080/test

⑧Enter username and password to test login

⑨Log in

The above is all the knowledge points about installing MySQL and configuring Java on Linux introduced this time. Thank you for your learning and support for 123WORDPRESS.COM.

You may also be interested in:
  • mysql-5.7.28 installation tutorial in Linux
  • Detailed tutorial on using cmake to compile and install mysql under linux
  • Tutorial on binary compilation and installation of MySql centos7 under Linux
  • How to configure Java environment variables in Linux system
  • Installation and configuration of Java environment variables under Linux
  • Detailed steps for installing Java and configuring environment variables in Linux CentOS 7.0

<<:  Vue custom table column implementation process record

>>:  Explanation of the use of GROUP BY in grouped queries and the SQL execution order

Recommend

MySql fuzzy query json keyword retrieval solution example

Table of contents Preface Option 1: Option 2: Opt...

MySQL table name case selection

Table of contents 1. Parameters that determine ca...

Implementation of CSS3 3D cool cube transformation animation

I love coding, it makes me happy! Hello everyone,...

Layim in javascript to find friends and groups

Currently, layui officials have not provided the ...

JS implements circular progress bar drag and slide

This article example shares the specific code of ...

10 Tips to Improve Website Usability

Whether it is a corporate website, a personal blo...

MySQL grouping queries and aggregate functions

Overview I believe we often encounter such scenar...

Tutorial on installing MySQL with Docker and implementing remote connection

Pull the image docker pull mysql View the complet...

Ubuntu compiles kernel modules, and the content is reflected in the system log

Table of contents 1.Linux login interface 2. Writ...

Three examples of nodejs methods to obtain form data

Preface Nodejs is a server-side language. During ...

Tutorial on building an FTP server in Ubuntu 16.04

Ubuntu 16.04 builds FTP server Install ftp Instal...

HTML tutorial, easy to learn HTML language (2)

*******************Introduction to HTML language (...

favico.ico---Website ico icon setting steps

1. Download the successfully generated icon file, ...

Understand CSS3 FlexBox elastic layout in 10 minutes

Basic Introduction Features Flexbox is a CSS disp...