2020年10月17日在阿里云上部署自己的项目的时候发生下图所示的问题,后来终于解决了,原因往下翻
原因:如果数据库在windows环境下,表是不区分大小写的。可是在linux环境下或者unix环境下是表是区分大小写的,所以为了避免这种情况,就需要修改mysql区分大小写的属性。
解决办法:
- 用root登录,修改 /etc/my.cnf;
- 在[mysqld]节点下,加入一行: lower_case_table_names=1
- 重启MySQL即可;
- linux重启方法
-
CentOS 7. mysql启动命令
[root@xufeng Desktop]# /bin/systemctl start mysqld.service
2.关闭命令[root@xufeng ~]# /bin/systemctl stop mysqld.service
3.重启命令[root@xufeng ~]# /bin/systemctl restart mysqld.service
或者代码中更改成对应的大小写表名。