部署TOMEXAM
前提:机器上有MySQL,nginx,jdk,tomcat
1.配置MySQL
[root@java-tomcat1 ~]# mysql -u root -p'Liuliu!123'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.26 MySQL Community Server (GPL)Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.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> create database tomexam default charset=utf8; #创建数据库设置字符集
Query OK, 1 row affected (0.00 sec)mysql> \q
Bye
2. tomexam包的相关配置
上传tomexam的代码
[root@java-tomcat1 ~]# unzip TomExam.zip
[root@java-tomcat1 ~]# cp -r ROOT/ /data/application/tomcat/webapps/
[root@java-tomcat1 ~]# cd /data/application/tomcat/webapps/
[root@java-tomcat1 webapps]# ls
ROOT
[root@java-tomcat1 webapps]# vim ROOT/WEB-INF/classes/config.properties
[root@java-tomcat1 ]# vim /etc/my.cnf ----添加sql_mod
sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUB
explicit_defaults_for_timestamp=1
[root@java-tomcat1]# mysql -uroot -p'Liuliu!123' -D tomexam < tomexam3_free.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@java-tomcat1 ]# systemctl restart mysqld
[root@java-tomcat1 ~]# /data/application/tomcat/bin/startup.sh
[root@java-tomcat1 ~]# netstat -lntp
之后访问IP:8080