简介:讲解如何创建新用户与删除用户并限制ip登录
创建用户的语法:create user 'username'@'host' identifified by 'password';
创建用户语法:
创建一个pig用户,并指定登录密码:123456,可以在任何一台远程主机都可以登录
创建一个pig用户,并指定登录密码:为空,指定在120网段的机器登录
查看权限:
mysqladmin -urootmysqladmin -uroot -proot password;
update mysql.user set authentication_string=password('root') where user='root' and
host='localhost';
username:你将创建的用户名
host:指定该用户在哪个主机上可以登陆,如果是本地用户可用localhost,如果想让该用户可以从任意远程主机 登陆,可以使用通配符%
password:该用户的登陆密码,密码可以为空,如果为空则该用户可以不需要密码登陆服务器
create user 'pig'@'%' identified by '123456';
create user 'pig'@'120.%.%.%' identified by '';
select * from mysql.user where