忽略大小写
8.0.26
docker run -d --name=db3307 -p 3307:3306 -e MYSQL_ROOT_PASSWORD=111111 mysql:8.0.26 --lower_case_table_names=1
5.7.35
docker run -d --name=db3307 -p 3307:3306 -e MYSQL_ROOT_PASSWORD=111111 mysql:5.7.35 --lower_case_table_names=1
- 需要挂载目录的话:
docker run -p 3307:3306 --name=db3307 \
--privileged=true \
--restart unless-stopped \
-v /opt/docker/mysql/conf:/etc/mysql \
-v /opt/docker/mysql/logs:/logs \
-v /opt/docker/mysql/data:/var/lib/mysql \
-v /etc/localtime:/etc/localtime \
-e MYSQL_ROOT_PASSWORD=111111 \
-d mysql:8.0.26 \
--lower_case_table_names=1
- 创建数据库命令
CREATE DATABASE `testdb` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_0900_ai_ci';
解决问题
Caused by: java.sql.SQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'cpms_v2.cpms_project.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
SHOW VARIABLES LIKE '%case%';
SET GLOBAL sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
评论 (0)