How to install JDK and Mysql on Ubuntu 18.04 linux system

Platform deployment

One, install JDK

step1. Download OracleJDK
step2. Unzip
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 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 #Edit 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 environment variables to make it effective
lemon@ubuntu:~$ java -version#Enter java -version, if the following information is displayed, the 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)

**2. Install **MySQL

step1. Install MySQL and configure
step2. Create database and table

Since I chose to install the LAMP service when installing the Ubuntu system, MySQL has been installed and only needs to be set to enable it.

Test whether to install:

lemon@ubuntu:~$ mysql #Enter mysql, if the following prompt appears, it means that mysql has been 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 will enter the MySQL setup process, the specific settings are 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 check 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 (Do not enable anonymous users)

#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 (root login remotely 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 (Reload privilege tables now)

All done!

Next, enter MySQL for operation:

After the latest version of MySQL is installed, you cannot log in with a password. You need to log in with sudo to modify the login method.

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: (the password set in the previous step, PASSWORD in brackets)
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,
prevFetchTime bigint(20) DEFAULT NULL,
inlinks mediumblob,
prevSignature blob,
outlinks mediumblob,
fetchTime bigint(20) DEFAULT NULL,
retriesSinceFetch int(11) DEFAULT NULL,
protocolStatus blob,
signature blob,
metadata blob,
batchIdvarchar(767)DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED
DEFAULT CHARSET=utf8mb4;
mysql>exit

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

Comment out bind-address = 127.0.0.1 and restart MySQL service

lemon@ubuntu:~$sudo service mysqld start

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

That's Ok

Recommended Posts

How to install JDK and Mysql on Ubuntu 18.04 linux system
How to install MySQL on Ubuntu 18.04 (linux)
How to install MySQL on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04
How to install MySQL on Ubuntu 14.04
How to install theano and keras on ubuntu system
How to install and configure NATS on Ubuntu 16.04
How to install and configure Gogs on Ubuntu 18.04
How to install and configure Cyberpanel on Ubuntu 18.04
How to install and secure phpMyAdmin on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure GitLab on Ubuntu 18.04
How to install and use Docker on Ubuntu 20.04
How to install and configure Ansible on Ubuntu 18.04
How to install and use Curl on Ubuntu 18.04
How to install and use Composer on Ubuntu 18.04
How to install and use Wine on Ubuntu 18.04
How to install and secure phpMyAdmin on Ubuntu 16.04
How to install and configure Elasticsearch on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
How to install and use Composer on Ubuntu 20.04
[Practice] How to install python3.6 on Ubuntu system
How to install and use BaasBox on Ubuntu 14.04
How to install and configure VNC on Ubuntu 18.04
How to install and configure OrientDB on Ubuntu 14.04
How to install and use PostgreSQL on Ubuntu 16.04
How to install Oracle Java 14 on Ubuntu Linux
How to install and configure AppScale on Ubuntu 12.04
How to install and use Docker on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
How to install the latest MySQL on Ubuntu 18.04
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
How to install Ruby on Ubuntu 20.04
How to install Memcached on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
How to install Nginx on Ubuntu 20.04
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
Install and configure MySQL on Ubuntu
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 16.04
How to install Git on Ubuntu 20.04
How to install Anaconda3 on Ubuntu 18.04
How to install mysql in Ubuntu 14.04
How to install Memcached on Ubuntu 18.04
How to install Jenkins on Ubuntu 16.04
How to install MemSQL on Ubuntu 14.04
How to install Go on Ubuntu 20.04
How to install MongoDB on Ubuntu 16.04
How to install Mailpile on Ubuntu 14.04
How to install PrestaShop on Ubuntu 16.04
How to install Skype on Ubuntu 20.04
How to install Jenkins on Ubuntu 20.04
How to install Python 3.8 on Ubuntu 18.04
How to install KVM on Ubuntu 20.04