Docker container mysql creates table error: Table 'mybatis_plus.USER' doesn't exist Problem solved

1. Error table 'mybatis_plus.USER' doesn't exist problem solved

CREATE TABLE user
(
	id BIGINT(20) NOT NULL COMMENT '主键ID',
	name VARCHAR(30) NULL DEFAULT NULL COMMENT '姓名',
	age INT(11) NULL DEFAULT NULL COMMENT '年龄',
	email VARCHAR(50) NULL DEFAULT NULL COMMENT '邮箱',
	PRIMARY KEY (id)
);
INSERT INTO USER (id, NAME, age, email) VALUES
(1, 'Jone', 18, '[email protected]'),
(2, 'Jack', 20, '[email protected]'),
(3, 'Tom', 28, '[email protected]'),
(4, 'Sandy', 21, '[email protected]'),
(5, 'Billie', 24, '[email protected]'),
(11, 'zhangsan', 50, '[email protected]'),
(12, 'pangsi', 33, '[email protected]'),
(13, 'liwu', 38, '[email protected]');

2. Analyze the reasons 

Because the database sets the case of the table, just set it to ignore case.

Modify the mysql database configuration:

Find the my.ini or my.cnf file in the service running directory, open it and find [mysqld] and add a line below

lower_case_table_names=1 (0: case sensitive; 1: case insensitive)

Restart the MySQL service

3. Solutions

We are the image mysql pulled by docker

So there is no need to modify the database configuration

We only need to change the corresponding database table name

Guess you like

Origin blog.csdn.net/qq_45037155/article/details/129750453