创建mysql帐户及增加权限

来源:互联网 发布:华彩人生炒股软件 编辑:程序博客网 时间:2024/05/20 07:36

创建账户3种方法:帐户名:username  密码:pwd

1、create user 'username'@'localhost' identified by 'pwd';

  这种方法创建完后没权限,增加所有权限:grant all privileges on *.* to 'username'@'localhost';

2、grant all privileges on *.* to 'username'@'localhost' identified by 'pwd' with grant option;这种方法创建完后有所有权限;

3、直接在user表中插入一条数据:

shell> mysql

shell>use mysql

mysql>insert into user values('localhost','username',password('pwd'),

'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');