Install java, Tomcat, MySQL
One, install Java
0, upload jdk to the specified directory
1. Unzip and move to the specified directory
unzip:
tar -zxvf jdk-8u152-linux-x64.tar.gz
Create a directory:
mkdir -p /usr/local/java
Mobile installation package:
mv jdk1.8.0_152/ /usr/local/java/
Set owner:
chown -R root:root /usr/local/java/
2. Configure environment variables
Configure system environment variables:
vim /etc/environment #打开environment 文件
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
export JAVA_HOME=/usr/local/java/jdk1.8.0_231
export JRE_HOME=/usr/local/java/jdk1.8.0_231/jre
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
Configure user environment variables:
vim /etc/profile #打开profile 文件
export JAVA_HOME=/usr/local/java/jdk1.8.0_231
export JRE_HOME=/usr/local/java/jdk1.8.0_231/jre
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin
Enable user environment variables to take effect
source /etc/profile
3. Verify that the installation is successful
java -version
Two, install Tomcat
1. Unzip and move to the specified directory
unzip:
tar -zxvf apache-tomcat-9.5.35.tar.gz
Change directory:
mv apache-tomcat-9.0.35 tomcat
2. Verify that the installation is successful
Start: enter the bin directory of tomcat
./startup.sh
stop:
./shutdown.sh
Three, install MySQL
1. Installation
Update the data source:
yum update
Download and install the official Yum Repository of MySQL:
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
Use yum command to install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
Install mysql server
yum -y install mysql-community-server
2. Start MySQL
systemctl start mysqld.service
View the execution status of MySQL
systemctl status mysqld.service
3. Check the database password:
Go to the /var/log directory to view the mysqld.log file. Use / add the password you want to search to see the password initialized by mysql itself. My password here is: 6sBelK-eMajY
4. Connect to the database
Check it
select * from dual;
An error was reported, the reason is that before executing the statement, you must use the ALTER USER statement to reset the password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'admin123';
It was wrong! ! ! [Password policy problem exception information]
First set a slightly more complicated
ALTER USER 'root'@'localhost' IDENTIFIED BY 'ZHANGadmin123.';
View password policy:
SHOW VARIABLES LIKE 'validate_password%';
5. About mysql password policy related parameters:
- validate_password_length The total length of the fixed password
- validate_password_dictionary_file specifies the file path for password verification
- validate_password_mixed_case_count The entire password must contain at least the total number of uppercase and lowercase letters
- validate_password_number_count The entire password must contain at least the number of Arabic numerals
- validate_password_policy specifies the password strength verification level. The default
value is MEDIUM . The value of validate_password_policy:
0/LOW: only verify length
1/MEDIUM: verify length, numbers, uppercase and lowercase, special characters
2/STRONG: verify length, numbers, uppercase and lowercase, Special characters, dictionary files - validate_password_special_char_count The entire password must contain at least the number of special characters
Modify the password rules [Don't do this online]
1. Change the password verification level to only verify length
2. Set the length to 5
and then test again.
You're done! ! !
6. Attention! ! !
But there is still a problem at this time, because the Yum Repository is installed, and every yum operation will be automatically updated in the future, you need to uninstall this: mysql57-community-release-el7-10.noarch
exit the database first
yum -y remove mysql57-community-release-el7-10.noarch
7. Remote connection
It is impossible to perform data operations here, let's connect with Navicat, but woc can't connect
! ! !
Don't worry! Follow the steps below to modify it:
use mysql; #选择数据库
update user set host ='%' where user = 'root'; # 修改远程机器访问 root 用户
flush privileges;
connection succeeded! ! !
Writing is not easy to focus on three batter, I will always continue to look forward to the next phase of the output ... linux configuration Thank you!
Encourage you...