CentOS下安装Tomcat9.0.63以及MySQL8.0.28(完美安装)

centos7安装mysql8.0.28

[root@localhost ~]# tar -xvf mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
mysql-community-client-8.0.28-1.el7.x86_64.rpm
mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm
mysql-community-common-8.0.28-1.el7.x86_64.rpm
mysql-community-devel-8.0.28-1.el7.x86_64.rpm
mysql-community-embedded-compat-8.0.28-1.el7.x86_64.rpm
mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm
mysql-community-libs-8.0.28-1.el7.x86_64.rpm
mysql-community-libs-compat-8.0.28-1.el7.x86_64.rpm
mysql-community-server-8.0.28-1.el7.x86_64.rpm
mysql-community-test-8.0.28-1.el7.x86_64.rpm
[root@localhost ~]# ll
总用量 1701628
drwxr-xr-x. 2 root root          6 7月   5 09:50 aaa
-rw-r--r--. 1 root root        137 7月   5 14:19 after.tar.gz
-rw-------. 1 root root       1701 11月 19 2021 anaconda-ks.cfg
drwxr--r--. 2 root root         99 7月   5 19:19 demo
-rw-r--r--. 1 root root         76 7月   5 14:10 demo.txt
drwxr-xr-x. 2 root root          6 7月   4 14:42 Desktop
drwxr-xr-x. 2 root root          6 7月   4 14:42 Documents
drwxr-xr-x. 2 root root          6 7月   5 19:31 Downloads
-rw-r--r--. 1 root root       1732 11月 19 2021 initial-setup-ks.cfg
-rw-r--r--. 1 root root          0 7月   5 15:42 lesson.sh
drwxr-xr-x. 2 root root          6 7月   4 14:42 Music
-rw-r--r--. 1 root root  843008000 7月   5 19:52 mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
-rw-r--r--. 1 7155 31415  55199948 12月 18 2021 mysql-community-client-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415   5933684 12月 18 2021 mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415    645388 12月 18 2021 mysql-community-common-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415   7763684 12月 18 2021 mysql-community-devel-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415  23637584 12月 18 2021 mysql-community-embedded-compat-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415   2215928 12月 18 2021 mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415   4935572 12月 18 2021 mysql-community-libs-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415   1265072 12月 18 2021 mysql-community-libs-compat-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 473116268 12月 18 2021 mysql-community-server-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 268279684 12月 18 2021 mysql-community-test-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 root root         26 7月   5 14:10 my.txt
drwxr-xr-x. 2 root root          6 7月   4 14:42 Pictures
drwxr-xr-x. 2 root root          6 7月   4 14:42 Public
drwxr-xr-x. 3 root root         31 7月   5 14:28 ss
drwxr-xr-x. 2 root root          6 7月   4 14:42 Templates
drwxr-xr-x. 3 root root         71 7月   5 14:15 test
drwxr-xr-x. 2 root root          6 7月   4 14:42 Videos
-r--r--r--. 1 root root   56431201 11月 19 2021 VMwareTools-10.3.10-13959562.tar.gz
[root@localhost ~]# rpm -qa|grep mariadb
mariadb-libs-5.5.65-1.el7.x86_64
[root@localhost ~]# rpm -e --nodes mariadb-libs
rpm: --nodes: 未知的选项
[root@localhost ~]# rpm -e --nodeps mariadb-libs
[root@localhost ~]# rpm -qa|grep mariadb
[root@localhost ~]# rpm -ivh mysql-community-common-8.0.28-1.el7.x86_64.rpm
警告:mysql-community-common-8.0.28-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:mysql-community-common-8.0.28-1.e################################# [100%]
[root@localhost ~]# rpm -ivh mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm
警告:mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:mysql-community-client-plugins-8.################################# [100%]
[root@localhost ~]# rpm -ivh mysql-community-libs-8.0.28-1.el7.x86_64.rpm
警告:mysql-community-libs-8.0.28-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:mysql-community-libs-8.0.28-1.el7################################# [100%]
[root@localhost ~]# rpm -ivh mysql-community-client-8.0.28-1.el7.x86_64.rpm
警告:mysql-community-client-8.0.28-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:mysql-community-client-8.0.28-1.e################################# [100%]
[root@localhost ~]# rpm -ivh mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm
警告:mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:mysql-community-icu-data-files-8.################################# [100%]
[root@localhost ~]# mysql-community-server-8.0.28-1.el7.x86_64.rpm
bash: mysql-community-server-8.0.28-1.el7.x86_64.rpm: 未找到命令...
[root@localhost ~]# rpm -ivh mysql-community-server-8.0.28-1.el7.x86_64.rpm
警告:mysql-community-server-8.0.28-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:mysql-community-server-8.0.28-1.e################################# [100%]
[root@localhost ~]# mysqld --initialize --console
[root@localhost ~]# chown -R mysql:mysql /var/lib/mysql/
[root@localhost ~]# systemctl start mysqld
[root@localhost ~]# cat /var/log/mysqld.log|grep localhost
2022-07-05T12:16:17.447203Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 7viCSry?!5JP
[root@localhost ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.28

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> alter user 'root'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
[root@localhost ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.28 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit
Bye
[root@localhost ~]# 
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

centos7安装Tomcat9.0.63

[root@localhost ~]# cd /usr/local
[root@localhost local]# mkdir software
[root@localhost local]# ls
a.txt  etc    include  lib    libexec  share     src
bin    games  kkk      lib64  sbin     software
[root@localhost local]# cd software
[root@localhost software]# mkdir tomcat
[root@localhost software]# ls
tomcat
[root@localhost software]# ll
总用量 0
drwxr-xr-x. 2 root root 41 7月   6 11:39 tomcat
[root@localhost software]# ls
tomcat
[root@localhost software]# cd tomcat
[root@localhost tomcat]# ls
apache-tomcat-9.0.63.tar.gz
[root@localhost tomcat]# ls -l
总用量 11308
-rw-r--r--. 1 root root 11576445 7月   6 11:39 apache-tomcat-9.0.63.tar.gz
[root@localhost tomcat]# tar -xvf apache-tomcat-9.0.63.tar.gz
[root@localhost tomcat]# cd apache-tomcat-9.0.63/bin
[root@localhost bin]# ./startup.sh
Using CATALINA_BASE:   /usr/local/software/tomcat/apache-tomcat-9.0.63
Using CATALINA_HOME:   /usr/local/software/tomcat/apache-tomcat-9.0.63
Using CATALINA_TMPDIR: /usr/local/software/tomcat/apache-tomcat-9.0.63/temp
Using JRE_HOME:        /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre
Using CLASSPATH:       /usr/local/software/tomcat/apache-tomcat-9.0.63/bin/bootstrap.jar:/usr/local/software/tomcat/apache-tomcat-9.0.63/bin/tomcat-juli.jar
Using CATALINA_OPTS:   
Tomcat started.
[root@localhost bin]# ps -ef | grep tomcat
root      50330  49526  0 11:44 pts/1    00:00:00 grep --color=auto tomcat
[root@localhost bin]# ./shutdown.sh  
[root@localhost bin]# ps -ef | grep tomcat
root      50389  49526  0 11:44 pts/1    00:00:00 grep --color=auto tomcat
[root@localhost bin]# ./startup.sh
[root@localhost bin]# ps -ef | grep tomcat
[root@localhost bin]# ./startup.sh
[root@localhost bin]# ps -ef | grep tomcat
root      51112  49526  0 11:51 pts/1    00:00:00 grep --color=auto tomcat
[root@localhost bin]# ls
#添加放行的端口号
[root@localhost ~]# firewall-cmd --add-port=8080/tcp --zone=public --permanent
success
[root@localhost ~]# systemctl restart firewalld
#移除放行的端口号
[root@localhost bin]# firewall-cmd --remove-port=8089/tcp --zone=public --permanent

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值