mysql常用语法


1、新建用户

create user 'username'@'%' identified by 'passwd';

2、新建数据库A

create database 数据库A

3、查看表内容

select * from db.table;

4、删除表的某些数据,例如删除id为10的这一行数据

delete from db.table where id=10;

5、修改表内容,例如将id为10的这一行A列信息改成no

update db.table set A='no' where id=10;

6、表中新增数据

insert  into db.table set A列=no;(只添加一条数据时)

insert into db.table value(a,b,c);(()中依次填写所有列的值)