安装好tomcat、java、mysql之后开始进行设置,首先在mysql中创建用户:
create database qiping;
use qiping;
grant all on qiping to qiping@'localhost' identified by 'Abc1357';
grant all on qiping.* to qiping@'localhost';
flush privileges ;
修改tomcat配置文件server.xml,修改端口:
<Connector port="18090" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="18453" />
<Context path="/" docBase="ruoyi-admin" reloadable="false"/>
然后上传war包,启动./bin/startup.sh,报错:
org.quartz.JobPersistenceException: Couldn't check for existence of job: Table 'qiping.QRTZ_JOB_DETAILS' doesn't exist [See nested exception: java.sql.SQLSyntaxErrorException: Table 'qiping.QRTZ_JOB_DETAILS' doesn't exist]
使用到了 Quartz 集群的特性,所以建了 MySql 的中间表,此错误显示的“QRTZ_JOB_DETAILS”表是存在,但却找不出,查找网上资料,可能是由于linux对大小写敏感判断导致,代码中的 sql 语句表明也都是用小写,所以未碰到。现在 Quartz 偏喜欢大写,问题也就这样来了。
知道原因,找解决办法就可有的放矢了,google mysql linux 表名不区分大小写,答案立马找到:
需要改 MySQL 的配置文件,Linux 下 MySQL 的配置文件可能是 /etc/my.cnf,或 /etc/mysql/my.cnf,这依赖于你的安装方式。假如是 /etc/my.cnf,那么执行
···
sudo vi /etc/my.cnf
在 [mysqld] 节中添加:
lower_case_table_names=1
···
然后保存,用 sudo /etc/init.d/mysql restart 重启 MySQL 服务便让 Linux 系统对表名大小写不敏感了。
之后再次启动mysql就没有问题了。
网友评论