MySQL平常操做命令(多操做几遍就会记住了):数据库
show databases; 查看数据库ide
create database test_db; 建立名为test_db数据库.net
use test_db; 进入test_db数据库。get
show tables; 查看数据库里有多少张表。table
create table test01 (id varchar(20),name varchar(20));建立名为test01表,并建立两个字段,id、name、数据长度(用字符来定义长度单位。)class
insert into test01 values ("001","wugk1"); 向表中插入数据。test
select * from test01; 查看test01表数据内容。date
Select * from test01 where id=1 and age =’jfedu’;多个条件查询。select
desc test01;查看test01表字段内容;权限
alter table test01 modify column name varchar(20);修改name字段的长度;
update test01 set name='start' where id=1; 修改name字段的内容;
受权命令:
grant all on test_db.* to test@localhost identified by '123456';
受权全部的test_db 库下面的全部表 ,给test用户,本地网段,密码123456
grant select,insert,update,delete on *.* to test@”%” identified by ‘123456’;
受权DML 权限给全部库和表,给全部网段的test用户,密码123456