查看mysql中的所有库
show databases;
使用库
use 库名;
显示库中的所有表
show tables;
查看表结构
show columns from 表名;
describe 表名;
新建或删除一个数据库
create database mydb;
drop database mydb;
删除表
drop table temp;
创建主键是自动增长的表name列为m
create table t(id int auto_increment primary key,name char(20) default'm');
删除表中所有数据
truncate table student;
增删改查
insert into userInfo(userName) values('longtao');
update userInfo set password='1111' where userID = 3;