用户(用户名与地址)
创建用户
create user '用户名'@'地址' identified by '密码'
若地址填localhost则只能本地访问,若地址改为%则任何地址都可以访问
分配权限
grant 权限1....on 数据库.表 to 用户名
grant all 数据库.表 to 用户名,所有权限all 所有数据库* 所有表*
撤销权限
revoke 权限1....on 数据库.表 from 用户
查看用户权限
show grants for 用户
删除用户
drop user 用户
修改密码
use mysql;
update user set password = password('密码') where user = '用户名' and host = 'IP';
flush privileges;