mysql -u -root -p
show databases;
use databaseName;
show tables;
CREATE TABLE test(
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(100),
PRIMARY KEY (id)
);
set auto_increment=1;
truncate table tableName; #注意这会清空table
insert into tableName (key1,key2) values(value1,value2);
update tableName set keyName = 'haha' where id = 111 #如果不加where子句限定那么所有key都会变成`haha`
select * from where id = 1 #where子句加限定条件
原文:https://www.cnblogs.com/just-save/p/11933102.html