mysql> flush privileges;
2创建数据库
create database newdatabase;
3为用户授权
1 2 |
|
也可以授予该用户特定的权限
grant select, insert,update,delete on newdatabase.* to admin@localhost identified by '123456';
共14种权限 select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file
mysql>grant all privileges on vtdc.* to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对数据库vtdc所有表进行所有操作的权限,并设定口令为123。
mysql>grant all privileges on *.* to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。
mysql>grant all privileges on *.* to joe@localhost identified by ‘123′;
给本机用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。
相关推荐:
MySQL中添加新用户权限的实例详解
Linux下为MySQL配置添加新用户
如何添加新用户到你的MySQL数据库
以上就是MySQL数据库添加新用户详解的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
更多相关阅读请进入《mysql》频道 >>

数据库系统概念 第6版
本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。