1、创建用户test 并赋予密码 1234567890
create user test identified by '1234567890';
用一下命令可以看到当前数据库中所有用户
select Host,User from mysql.user;
2、指定数据库给指定账号
all代表接受所有操作,比如 select,insert,delete....;
testdb.* 代表testdb数据库库下面的所有表;
% 代表这个用户允许从任何地方登录;为了安全期间,这个%可以替换为你允许的ip地址;
grant all privileges on testdb.* to 'sy12315'@'%'identified by 'pwd12315#@!Q' with grant option;
3、刷新权限
flush privileges;
4、删除某个用户
Delete FROM user Where User='root' and Host='70.196.40.106';