Installing the Java Runtime Environment for Linux

        Taking advantage of 12 double discount, in the Baidu cloud start a new server. CentOS 7.6 system installed. Internet to find many tutorials installed JAVA environment, but not very wide, so can only yourself, integrate an out. My approach is purely server above operation, did not use up a copy of the software installation method. In order to meet the more commonly used environment, I am a JDK8, Mysql5.7, Tomcat8.5 the software installed on the operating system on it.

Preparations
installation directory

We create the following path / usr / develop, and then create java, tomcat and mysql three directories can develop in the list below.

 

 You can see the corresponding catalog has been added successfully changed the directory

 

First, configure the JDK
understand wget command

wget is a command to download files from the Internet free tool which supports http protocol, https and ftp protocols. Therefore, we can download the JDK by wget command.
The format wget: wget to download url. Download the catalog for the current directory wget command execution.

// Download 
$ wget https://repo.huaweicloud.com/java/jdk/8u201-b09/jdk-8u201-linux-x64.tar.gz
// unpack $ tar -zxvf jdk-8u201-linux -x64.tar .gz
// move folder
$ mv jdk1.8.0_201 /usr/local/jdk1.8/

1. Set Environment Variables

vim / etc / profile
press insert key, and then move to the last line, add the following statement

export JAVA_HOME=/usr/local/jdk1.8
export PATH=$JAVA_HOME/bin:$PATH 
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 

2. Configure the additional update is completed

source /etc/profile

3. Check whether the installation is successful

java -version

 

 

Second, the installation MySqlServer

1, download Mysql yum package

yum package file can be found on the official website mysql in http://dev.mysql.com/downloads/repo/yum/

Usually the default is to display the latest version of noarch.rpm file mysql

Downloaded to the local then uploaded to the server, or directly download using wget

Here we have a download version 5.7 file

wget http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm

2, Ann transfer yum software source

Run the following command to install

rpm -Uvh mysql57-community-release- el7-10.noarch.rpm
install the software source yum
image

3, install mysql server

yum install -y mysql-community-server

Mysql server installation, this step is relatively long, I waited more than one hour to complete.

 

4, start mysql

service mysqld start

5, check the operating status of mysql

service mysqld status

6, modify the temporary password

After Mysql5.7 is installed by default root password.

7, to obtain temporary password MySQL

为了加强安全性,MySQL5.7为root用户随机生成了一个密码,在error log中,error log的位置,默认是 /var/log/mysqld.log。

只有启动过一次mysql才可以查看临时密码

grep 'temporary password' /var/log/mysqld.log
(如果之前安装过MySQL则这里可能会有多个密码,用最后一个,注意这个密码输入时是可以粘贴的) 查看临时

 

这里的密码是:v6BlUX=VgsfQ

8、 登陆并修改密码

使用默认的密码登陆

mysql -uroot -p(这是一个MySQL的以密码登录root用户的命令)

mysql -uroot -p v6BlUX=VgsfQ
用该密码登录到服务端后,必须马上修改密码再执行一些数据库操作,不然会报如下错误:

mysql> select @@log_error;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
修改密码

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';
修改密码
image

如何解决ERROR 1819 (HY000): Your password does not satisfy the current policy requirements呢? 按如下操作

必须修改两个全局参数:
首先,修改validate_password_policy参数的值

mysql> set global validate_password_policy = 0;
then modify the length of the password

mysql> set global validate_password_length = 1;
modify the length
image

Modify the password again to perform on it

mysql> ALTER USER 'root' @ 'localhost' IDENTIFIED BY ' new password';
9, authorize other machines landing

mysql>use mysql;
msyql>update user set user.Host='%' where user.User='root';
mysql>flush privileges;

Such local computer can connect to a remote server mysql database.

At this point the installation is finished!

Third, install Tomcat
// download 
wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.50/bin/apache-tomcat-8.5.50.tar.gz // extract the
tar -zxvf apache-tomcat -8.5.50.tar.gz // move
mv apache-tomcat-8.5.50 / usr / develop / tomcat /

Switch to the bin directory

cd /usr/develop/tomcat/apache-tomcat-8.5.50/bin/

Running tomcat

./startup.sh 

 Browser and enter ip: port view information

 

 

 

 
 
 

Guess you like

Origin www.cnblogs.com/shuideqing/p/12038004.html