Construction of the project environment on Linux
官网下载VMware:https://www.vmware.com/cn/products/workstation-pro/workstation-pro-evaluation.html
Key: UY758-0RXEQ-M81WP-8ZM7Z-Y3HDA
CentOS 7 official website download: https://www.centos.org/download/
Alibaba Cloud mirror download: http://mirrors.aliyun.com/centos/7/isos/x86_64/
1. Install jdk
1. First you need to uninstall the jdk that comes with the system
rpm -qa | grep jdk
rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.242.b08-1.el7.x86_64
rpm -e --nodeps copy-jdk-configs-3.3-10.el7_5.noarch
rpm -e --nodeps java-1.8.0-openjdk-1.8.0.242.b08-1.el7.x86_64
2. Create a java directory under /usr/local/, transfer the jdk rpm package to this path, and install it with the following command:
rpm -ivh jdk-8u221-linux-x64.rpm
3. Configure environment variables
vi /etc/profile
JAVA_HOME=/usr/java/jdk1.8.0_221-amd64
CLASSPATH=%JAVA_HOME%/lib:%JAVA_HOME%/jre/lib
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export PATH CLASSPATH JAVA_HOME
4. Let the environment variable configuration take effect
source /etc/profile
2. Install Tomcat
1. Create a tomcat directory under /usr/local/, transfer the tomcat package to this path and unzip:
tar -zxvf apache-tomcat-9.0.34.tar.gz
2. Enter the bin directory and start tomcat
./startup.sh
3. Open port 8080
- Check the firewall status, if it is closed, you need to open the firewall first
firewall-cmd --state
- Turn on the firewall
systemctl start firewalld.service
- Open port
firewall-cmd --zone=public --add-port=8080/tcp --permanent
- Restart firewall
systemctl restart firewalld.service
- Reload configuration
firewall-cmd --reload
3. Install mysql
1. Create a mysql directory under /usr/local/, transfer and unzip the mysql package:
tar -xvf mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar
2. Delete the built-in mariadb
查看mariadb
rpm -qa |grep mariadb
强制删除mariadb
rpm -e mariadb-libs-5.5.65-1.el7.x86_64 --nodeps
3. Install 4: common, libs, client, server
rpm -ivh mysql-community-common-8.0.20-1.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-libs-8.0.20-1.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-client-8.0.20-1.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-server-8.0.20-1.el7.x86_64.rpm --nodeps --force
4. Initialize mysql
mysqld --initialize
如果报错:mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
yum install -y libaio
5. Authorized firewall
chown mysql:mysql /var/lib/mysql -R
systemctl start mysqld.service
systemctl enable mysqld
6. View the database initialization password
cat /var/log/mysqld.log | grep password
=wy727d4A%.?
7. Log in to the database
mysql -uroot -p
=wy727d4A%.?
8. Change password
ALTER USER "root"@"localhost" IDENTIFIED BY "123456";
9. Enable remote access
create user "root"@"%" identified with mysql_native_password by "123456";
grant all privileges on *.* to "root"@"%" with grant option;
flush privileges;
10. Open port 3306
firewall-cmd --zone=public --add-port=3306/tcp --permanent
systemctl restart firewalld.service
firewall-cmd --reload
11. Time zone +8
set global time_zone="+8:00";