2.1搭建环境 搭建数据库-创建表 CREATE TABLE `user` ( `id` int(20) NOT NULL, `name` varchar(30) DEFAULT NULL, `pwd` varchar(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT into `user`(id,name,pwd) VALUES (1,'张三','123456'), (2,'李四','123456'), (3,'王五','123456') 新建项目 新建一个maven项目 删除src目录使其成为父工程 导入maven依赖 <!--导入依赖--> <dependencies> <!--mysql--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.47</version> </dependency> <!--mybatis--> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.2</version> </dependency> <!--junit--> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> </dependencies>
标签:123456,DEFAULT,导入,MyBatis,NULL,id,搭建 From: https://www.cnblogs.com/muzhaodi/p/17802737.html