mysql添加用户 (linux)
来源:互联网 发布:c 定义未知长度的数组 编辑:程序博客网 时间:2024/06/06 05:05
mysql添加用户
bin>mysql -u root
mysql> grant 权限1,权限2,…权限n on 数据库名称.表名称 to 用户名@用户地址 identified by ‘连接口令’;
权限1,权限2,…权限n代表select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file等14个权限。
当权限1,权限2,…权限n被all privileges或者all代替,表示赋予用户全部权限。
当数据库名称.表名称被*.*代替,表示赋予用户操作服务器上所有数据库所有表的权限。
用户地址可以是localhost,也可以是ip地址、机器名字、域名。也可以用’%'表示从任何地址连接。
‘连接口令’不能为空,否则创建失败。
例如:
mysql>grant select,insert,update,delete,create,drop on vtdc.employee to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对数据库vtdc的employee表进行select,insert,update,delete,create,drop等操作的权限,并设定口令为123。
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添加用户方法
建立数据库gamesp
create database gamesp;
添加用户
grant all on 数据库名.* to 用户名@localhost identified by '密码';
grant all on gamesp.* to newuser@localhost identified by 'password';
添加一个远程用户,名为username密码为password
GRANT ALL PRIVILEGES ON *.* TO username@"%" IDENTIFIED BY 'password'
说明:
(1)grant all 赋予所有的权限
(2)gamesp.* 数据库 gamesp 中所有的表
(3)newuser 用户名
(4)@localhost 在本地电脑上的 mysql server 服务器
(5)identfified by 'password' 设置密码
删除用户
use mysql
mysql>Delete FROM user Where User="xxxxx" and Host="localhost";
mysql>flush privileges;
修改密码
mysqladmin -uroot -plk317921web password "111111"
- mysql添加用户 (linux)
- linux Grant 添加 MySql 用户
- linux 下 mysql 添加用户及管理用户
- Linux mysql添加用户,删除用户,以及用户权限
- linux(ubuntu)添加用户
- mysql添加(删除)用户方法
- 添加mysql用户
- mysql 添加用户
- mysql 添加用户
- mysql添加用户
- MySQL添加用户
- Mysql添加用户
- mysql添加远程用户
- mysql添加用户。
- mysql添加用户。
- mysql添加用户
- mysql添加用户
- mysql添加用户
- 关于JqGrid + MVC 提交表格数据,提交多行数据
- 如何在gambit中简化带隔板的模型(转载)
- itextSharp研究心得
- 盘点那些年,被Oracle收购的公司
- 编程技术面试的五大要点
- mysql添加用户 (linux)
- hdu 3436 Queue-jumpers(splay tree)
- 位运算实现加减乘除、求补、比较、正负判断
- 【谷歌面试题】在O(1)时间内删除链表节点
- Flex progressbar in datagrid
- USB3.0电源管理
- 碉堡了!体验QQ自带“全透明”皮肤!
- Android应用资源---字符串资源类型(String)
- 笔记:通过Spring工具类获取classpath下的文件资源