索引名(列名)
主键索引 primary key --只能有一个
唯一索引 unique key age(age) --可以有多个,避免重复列出现,age为索引名,age为列名
常规索引 key/index age(age) --默认有的
全文索引 fulltext age(age) --本来myisam才有 快速定位数据
alter table A1 add primary key age(age) --在A1中添加主键age,索引名是age
create primary key idd on A1(id) --创建一个名为idd的索引在表A1字段id上
explain select * from A1 --分析sql执行状况
select * from A1 where match(age) against('0') --匹配age有带0的
--------------------------------------------------------------------------------------------
create user chuchu identified by '123456' --创建用户chuchu通过密码123456识别
set password=password('111111') --当前用户改名
set password for chuchu=password('111111') --指定用户改名
rename user chuchu to qinqin --改用户名
grant all privileges on *.* to chuchu --给chuchu授权除了给别人授权的所有权限
show grants for chuchu --查看指定用户权限
Mysql索引和用户权限
最新推荐文章于 2024-08-29 16:07:29 发布