一.安装java (不需要再去配置环境变量,直接安装就可以)
1.查看yum源的java包: yum list java*
2.安装java 1.8 jdk : yum -y install java-1.8.0-openjdk
3.查看是否安装成功: java -version
二.安装Tomcat
1.到tomcat官网下载安装包
2.将下载好的安装包上传到云服务器/usr/local文件夹
3.cd /usr/local
4.tar -zxf apache-tomcat-7.0.70.tar.gz(下载的压缩包名称)
5.cd cd /usr/local/apache-tomcat-7.0.70/bin
6../startup.sh
三.安装mysql
1.首先进入mysql官网的下载-社区https://dev.mysql.com/downloads/
2.点击下载后,在下载页面选择操作系统
3.点击下载rpm文件,拿到这个下载链接
4.移除mariadb数据库
yum remove mariadb-libs.x86_64
5.进入到/tmp目录使用wget下载
wget https://repo.mysql.com//mysql80-community-release-el7-2.noarch.rpm
6.安装mysql的源
yum localinstall mysql80-community-release-el7-2.noarch.rpm
7.通过查找命令找到社区版的安装文件
yum search mysql
8.安装mysql
yum install mysql-community-server.x86_64
9.开启mysql服务
systemctl start mysqld
10.查看myqsl的默认密码
cat /var/log/mysqld.log
2019-03-27T03:05:34.627566Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.15) initializing of server in progress as process 291142019-03-27T03:05:38.631106Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost:I+w=67d(默认密码);+ES82019-03-27T03:05:40.427422Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.15) initializing of server has completed2019-03-27T03:05:42.371036Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.15) starting as process 291612019-03-27T03:05:43.074650Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.2019-03-27T03:05:43.117341Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.0.15’ socket: ‘/var/lib/mysql/mysql.sock’ port: 3306 MySQL Community Server – GPL.2019-03-27T03:05:43.166968Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: ‘/var/run/mysqld/mysqlx.sock’ bind-address: ‘::’ port: 33060
11.使用密码进行登陆mysql
mysql -uroot -p
12.修改设置密码的验证规则
set global validate_password.policy=0;
set global validate_password.length=1;
13.修改root的密码
alter user ‘root’@’localhost’ identified by ‘新密码’;
14.退出后,使用新密码登陆。查看数据库。
mysql -u root -p
mysql> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| mysql |
| performance_schema |
| sys |
+——————–+
4 rows in set (0.00 sec)