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

Example of installing JDK and Mysql on Ubuntu18.04 linux system

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

Share

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

Editor to share with you an example of Ubuntu18.04 linux system installation of JDK and Mysql, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Platform deployment

First, install JDK

Step1. Download OracleJDK

Step2. Decompression

Step3. Add environment variables

The specific operations are as follows:

Lemon@ubuntu:~$ cd ~ / download/

Lemon@ubuntu:~/download$ wget https://download.oracle.com/otn-pub/java/jdk/13.0.2+8/d4173c853231432d94f001e99d882ca7/jdk-13.0.2_linux-x64_bin.tar.gz

Lemon@ubuntu:~/download$ tar vxf jdk-8u191-linux-x64.tar.gz

Lemon@ubuntu:~/download$ ls # View the files in the current directory

Jdk1.8.0_191 jdk-8u191-linux-x64.tar.gz

Lemon@ubuntu:~/download$ sudo mv jdk1.8.0_191/ / usr/local/jdk1.8/ # move the jdk1.8.0_191 folder to / usr/local/ and rename it to jdk1.8

Lemon@ubuntu:~/download$ sudo vim / etc/profile # Editing environment variables

Add the following at the end of the environment variable:

Export JAVA_HOME=/usr/local/jdk1.8

Export JRE_HOME=$ {JAVA_HOME} / jre

Export CLASSPATH=.:$ {JAVA_HOME} / lib:$ {JRE_HOME} / lib

Export PATH=.:$ {JAVA_HOME} / bin:$PATH

Reload the environment variable after saving to make it effective:

Lemon@ubuntu:~/download$ source / etc/profile # refresh the environment variable to make it effective

Lemon@ubuntu:~$ java-version# enter java-version. If the following information is displayed, JDK installation is successful.

Java version "1.8.0,191"

Java (TM) SE Runtime Environment (build 1.8.0_191-b12)

Java HotSpot (TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

Second, install MySQL

Step1. Install MySQL and configure

Step2. Create databases and tables

Since I chose to install the LAMP service when installing the Ubuntu system, MySQL has been installed and can be enabled only by setting up.

Test whether or not to install:

Lemon@ubuntu:~$ mysql # enter mysql, and if prompted below, mysql is installed

ERROR 1045 (28000): Access denied for user 'lemon'@'localhost' (using password: NO)

If not installed:

Lemon@ubuntu:~$ sudo apt-get install mysql-server

Lemon@ubuntu:~$sudo apt isntall mysql-client

Lemon@ubuntu:~$sudo apt install libmysqlclient-dev

If installed:

Lemon@ubuntu:~$ sudo mysql_secure_installation

Both of them will enter the MySQL setting process, which is as follows:

# 1

VALIDATE PASSWORD PLUGIN can be used to test passwords...

Press y | Y for Yes, any other key for No: n (weak password checking is not enabled)

# 2

Please set the password for root here...

New password: (set root password)

Re-enter new password: (repeat input)

# 3

By default, a MySQL installation has an anonymous user

Allowing anyone to log into MySQL without having to have

A user account created for them...

Remove anonymous users? (Press y | Y for Yes, any other key for No): y (anonymous users are not enabled)

# 4

Normally, root should only be allowed to connect from

'localhost'. This ensures that someone cannot guess at

The root password from the network...

Disallow root login remotely? (Press y | Y for Yes, any other key for No): y (remote login of root is not allowed)

# 5

By default, MySQL comes with a database named 'test' that

Anyone can access...

Remove test database and access to it? (Press y | Y for Yes, any other key for No): n

# 6

Reloading the privilege tables will ensure that all changes

Made so far will take effect immediately.

Reload privilege tables now? (Press y | Y for Yes, any other key for No): y (refresh the permission table immediately)

All done!

Next, enter the MySQL to do the following:

# after the latest version of MySQL is installed, you cannot log in with a password. You need to change the login method by logging in to sudo.

Lemon@ubuntu:~$ sudo mysql-uroot-p

Enter password: (empty password)

Mysql >

Mysql > UPDATE mysql.user SET authentication_string=PASSWORD ('LEMON'), plugin='mysql_native_password' WHERE user='root'

Mysql > FLUSH PRIVILEGES

Mysql > exit

Lemon@ubuntu:~$ sudo service mysql restart

Lemon@ubuntu:~$ mysql-u root-p

Enter password: (password set in the previous step, PASSWORD in parentheses)

Mysql > CREATE DATABASE nutch

Mysql > USE nutch

Mysql > CREATE TABLE `webpage` (

`id`varchar (767) NOT NULL

`headers` blob

`text`mediumtext DEFAULT NULL

`status` int (11) DEFAULT NULL

`markers` blob

`parseStatus` blob

`modifiedTime` bigint (20) DEFAULT NULL

`score` float DEFAULT NULL

`typ` varchar (32) CHARACTER SET latin1 DEFAULT NULL

`baseUrl` varchar (767) DEFAULT NULL

`content` longblob

`title`varchar (2048) DEFAULT NULL

`reprUrl` varchar (767) DEFAULT NULL

`fetchInterval` int (11) DEFAULT NULL

`roomFetchTime` bigint (20) DEFAULT NULL

`inlinks` mediumblob

`The Signature` blob

`outlinks` mediumblob

`fetchTime` bigint (20) DEFAULT NULL

`roomesSinceFetch` int (11) DEFAULT NULL

`roomStatus` blob

`feature` blob

`metadata` blob

`batchId`varchar (767) DEFAULT NULL

PRIMARY KEY (`id`)

) ENGINE=InnoDB

ROW_FORMAT=COMPRESSED

DEFAULT CHARSET=utf8mb4

Mysql > exit

* in the latest version, remote login is not allowed in MySQL by default. If you need remote access, you need to make some modifications:

Lemon@ubuntu:~$sudo vim / etc/mysql/mysql.conf.d/mysqld.cnf

# comment out bind-address = 127.0.0.1 and restart the MySQL service

Lemon@ubuntu:~$sudo service mysqld start

Then you can access the database on other computers through software such as Navicat.

So it's Ok.

These are all the contents of this article entitled "examples of installing JDK and Mysql on Ubuntu18.04 linux systems". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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