Mysql创建用户的三种基本方法

1.采用create user

e.g.  create user 'username'@'host' identified by 'password';

 

2.采用grant语句

e.g.  grant all privileges on *.* to 'username'@'host' identified by 'passwd' with grant option;

 

3.直接用insert语句插入mysql.user表中

e.g. 

use mysql;

insert into user(user,host,password) values('test4','192.168.203.128',password('123456'));

 

posted @ 2015-07-07 19:44  泽锦  阅读(363)  评论(0编辑  收藏  举报