因为我是总结别人的然后结和我自己实际写的这个,所以我把借鉴的放前面。以此感谢这些人的辛勤付出。谢谢你们。
(这是盘符固定的,安装程序,如果想将程序放在任意盘符下,那等更新吧!弄不明白的话参照第一个链接,不懂的话参照第二个链接。有什么问题,可以tomcat日志查看,或者想想你哪做错了~)
参照连接(主要的):https://blog.csdn.net/qq_33240866/article/details/80066541
参考连接(参数配置信息):https://blog.csdn.net/dj0721/article/details/72462688/
参考连接(MySQL5.7.24安装,打包用的MySQL配置):https://blog.csdn.net/qq_38455201/article/details/83419450
参考连接(MYSQL8.0.17<我要给客户打包,这个安装方法会将密码直接展示,没办法提取,所以用着麻烦,如果你自己配置mysql8.0.17的话可以用>):https://blog.csdn.net/wutong14220/article/details/99108518
参考连接(MySQL8.0.17打包用的mysql配置):https://www.jb51.net/article/167678.htm
(有些连接你可能觉得用不上,但是对于我来说真的很有用。)
准备东西
1.下载免安装的mysql(5.5.40)、tomcat(8.5.43)、jdk(jdk1.8.0_65,都是64位的);
2.下载Inno Setup 打包工具(我用的是:Inno Setup 6版);
3.我在C盘建了个文件夹,命名为test ;
4.把下载好的mysql-5.5.40、tomcat8.5.43一起复制到“C:\test”下;
5.如果你要弄个图标的话,再弄个.ico 一起放到“C:\test”下:
大概步骤
打包准备,用到的文件
1.将IDEA中的项目,打包成 .war 文件。解压该 .war 文件,将数据库的配置文件放到指定位置:
我的src文件 百度网盘: 链接:https://pan.baidu.com/s/13tYUfATfJSBPdeU0W2Bt5w
提取码:in8n
把src文件编辑好之后,将文件重新打包成 .war 文件。
<我的项目从IDEA里面打包出来是没有数据库连接配置的,如果你自己的有,忽略这一步。>
将重新打包的war文件放到“C:\test\apache-tomcat-8.5.43\webapps”下;(我的项目打包之后叫web1_war.war)
2.将JDK复制粘贴进来:
JDK我的版本是1.8.0.65,安装.exe之后直接将安装后生成的文件夹复制之后放在:“C:\test\apache-tomcat-8.5.43\bin\Java ”下
3.将数据,也就是.sql文件,放在“C:\test\mysql-5.5.40-winx64\data”下;
打包准备,用到的脚本
MYSQL
1.官网上下载的mysql是没有my.ini文件的,所以我们要自己写。
附上我自己写的(只需要把没有“#”号的复制进去就行)
<-- my.ini 文件内容 -->
# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows you should keep this file in the installation directory
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup option
# "--defaults-file".
#
# To run run the server from the command line, execute this in a
# command line shell, e.g.
# mysqld --defaults-file="D:\test\mysql-5.5.40-winx64\my.ini"
#
# To install the server as a Windows service manually, execute this in a
# command line shell, e.g.
# mysqld --install MySQLXY --defaults-file="D:\test\mysql-5.5.40-winx64\my.ini"
#
# And then execute this in a command line shell to start the server, e.g.
# net start MySQLXY
#
#
# Guildlines for editing this file
# ----------------------------------------------------------------------
#
# In this file, you can use all long options that the program supports.
# If you want to know the options a program supports, start the program
# with the "--help" option.
#
# More detailed information about the individual options can also be
# found in the manual.
#
#
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client appli