MYSQL对数据库和表的基本操作
CREATE DATABASE testdb CHARSET=UTF8 创建一个数据库 名字叫做testdb USE testdb; 选择数据库 CREATE TABLE testTable1( -> id int(11) not null primary key auto_increment, -> username char(16) not null, -> password char(16) not null); 创建一个表 名字为testTable1 第一个字段名字为 id 最大11个字符 not null 不允许为空 Primary key 设置主键 auro_increment,自动增长 第二个字段名字为username char型最大16个字符 不允许为空 第二个字段名字为password char型最大16个字符 不允许为空 DROP TABLE testTable1;DROP DATABASE testdb; 删除一个表 删除一个数据库 来源: https://www.cnblogs.com/hack747/p/12390888.html