-- 删除tb_user表 DROP TABLE IF EXISTS tb_user; -- 创建tb_user表 CREATE TABLE tb_user( id int, username VARCHAR(20), password VARCHAR(32) ); -- 添加数据 INSERT INTO tb_user VALUES(1,'zhangsan','123'),(2,'lisi','234'); SELECT * from tb_user; -- ' or '1' = '1 select * from tb_user where username = 'hfkjsfhskj' and password = '\' or \'1\' = \'1'
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.itheima</groupId> <artifactId>maven-project</artifactId> <version>1.0-SNAPSHOT</version> <properties> <maven.compiler.source>8</maven.compiler.source> <maven.compiler.target>8</maven.compiler.target> </properties> <!-- 导入 mysql 驱动jar包 --> <dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.32</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.12</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.13</version> <scope>test</scope> </dependency> </dependencies> </project>
标签:11,总结,VARCHAR,--,com,user,mysql,tb From: https://www.cnblogs.com/liucaizhi/p/17307905.html