mysql 权限管理 对所有库 所有表 授权 *.*
对miek这个账号localhost 授予了所有库,所表的select权限
- mysql> grant select on *.* to 'mike'@'localhost';
- Query OK, 0 rows affected (0.00 sec)
- mysql> exit
- Bye
- [root@mysql ~]# mysql -umike -p123
- Warning: Using a password on the command line interface can be insecure.
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 4
- Server version: 5.6.36 Source distribution
- Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
- Oracle is a registered trademark of Oracle Corporation and/or its
- affiliates. Other names may be trademarks of their respective
- owners.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql>
- mysql> show databases;
- +--------------------+
- | Database |
- +--------------------+
- | information_schema |
- | company |
- | db1 |
- | db2 |
- | db3 |
- | db4 |
- | db5 |
- | db6 |
- | mysql |
- | performance_schema |
- | test |
- | test2 |
- | test_1 |
- +--------------------+
- 13 rows in set (0.04 sec)
- mysql> use db1;
- Reading table information for completion of table and column names
- You can turn off this feature to get a quicker startup with -A
- Database changed
- mysql> show tables;
- +---------------+
- | Tables_in_db1 |
- +---------------+
- | innodb__t_t1 |
- | innodb__t_t2 |
- | innodb__t_t3 |
- | innodb__t_t4 |
- | t1 |
- | t3 |
- +---------------+
- 6 rows in set (0.00 sec)
- mysql> select * from t1;
- +------+------+--------+------+
- | id | name | sex | age |
- +------+------+--------+------+
- | 1 | mike | male | 15 |
- | 2 | alex | female | 16 |
- | 3 | NULL | NULL | NULL |
- | 4 | NULL | NULL | NULL |
- +------+------+--------+------+
- 4 rows in set (0.01 sec)
- mysql> desc t1;
- +-------+-----------------------+------+-----+---------+-------+
- | Field | Type | Null | Key | Default | Extra |
- +-------+-----------------------+------+-----+---------+-------+
- | id | int(11) | YES | | NULL | |
- | name | varchar(50) | YES | | NULL | |
- | sex | enum('male','female') | YES | | NULL | |
- | age | int(4) | YES | | NULL | |
- +-------+-----------------------+------+-----+---------+-------+
- 4 rows in set (0.00 sec)
- mysql> insert into t1 values(5,'jack','male',50);
- ERROR 1142 (42000): INSERT command denied to user 'mike'@'localhost' for table 't1'
没有插入记录权限,只有select权限
mysql 权限管理 对所有库 所有表 授权 *.*的更多相关文章
- mysql 权限管理 针对某个库 某张表 授权 tables_priv表
精确到表级别 针对db1的t3表 授予select权限 mysql> grant select on db1.t3 to 'mike'@'localhost'; Query OK, rows a ...
- mysql 权限管理 针对表的字段 级别 授权 columns_priv表
针对Mike账号 db1库下面的t1表的 id,name字段授予select权限,age字段授予update权限 授权格式 select(要授权的字段,要授权的字段) 用户括号 括起来 .updat ...
- mysql 权限管理 目录
mysql 权限管理介绍 mysql 权限管理 记录 mysql 权限管理 grant 命令 mysql 权限管理 revoke 回收权限 命令 mysql 权限管理 针对库 授权 db.* mysq ...
- mysql 权限管理介绍
mysql权限管理 就是对控制用户对库.对表的权限.对表中字段权限 权限管理分步 1.创建账号 创建账号有本地账号和远程账号 本地账号 本地账号只能在mysql服务端机器做操作 '; # mysql ...
- MySQL权限管理、配置文件(三)
一.MySQL权限管理 GRANT 权限 ON 授权范围 TO '用户名'@'允许的ip(所有%)' IDENTIFIED BY '用户密码'; 权限:参加下表,一般常用的是CREATE.DELETE ...
- mysql权限管理命令示例
mysql权限管理命令示例 grant all privileges on *.* to *.* identified by 'hwalk1'; flush privileges; insert in ...
- mysql 权限管理 针对库 授权 db.*
需求 只放行user表 db1库的select权限 mysql> grant select on db1.* to 'mike'@'localhost'; Query OK, rows affe ...
- mysql权限管理
经常遇到有网友在QQ群或者论坛上问关于mysql权限的问题,今天抽空总结一下关于这几年使用MYSQL的时候关于MYSQL数据库的权限管理的经验,也希望能对使用mysql的网友有所帮助! 一.MYSQL ...
- mysql 权限管理
参考: http://www.cnblogs.com/Richardzhu/p/3318595.html 一.MySQL权限简介 关于mysql的权限简单的理解就是mysql允许你做你全力以内 ...
随机推荐
- java 递归
package com.j1.soa.resource.cms.service.oracle; import com.j1.base.dto.ServiceMessage; import com.j1 ...
- 两台Linux主机互传文件可以使用SCP命令来实现
当两台linux主机之间要互传文件时可使用SCP命令来实现 复制文件: (1)将本地文件拷贝到远程 scp 文件名 --用户名@计算机IP或者计算机名称:远程路径 (2)从远程将文件拷回本地 scp ...
- log4net日志的简单配置
说起来log4net,我一直都知道这个的存在,但实际在项目中还真是没有去自己写过的那,这一次我在项目完成后并没有着急下一个项目的开始,于是突然想起来是否添加一个日志的编写,于是开始了log4net的总 ...
- Mac下Intellij IDea发布JavaWeb项目 详解三 (为所有Module配置Tomcat Deployment 并测试web 网页 配置Servlet)
step4 为所有项目配置Deployment 4.1 如图 4.2 [+][Artifact] 4.3 将这里列出的所有内容选中后,点[OK] 4.4 选完是这样,表示,这三个java ee 项目会 ...
- JS动态设置确认弹窗
多次使用确认弹窗 <!--START 确认收货--> <div class="popout-boxbg out" id="delivery_goods& ...
- Writing Reentrant and Thread-Safe Code(译:编写可重入和线程安全的代码)
Writing Reentrant and Thread-Safe Code 编写可重入和线程安全的代码 (http://www.ualberta.ca/dept/chemeng/AIX-43/sha ...
- 【vue学习】vue中怎么引用laydate.js日期插件
此贴意在解决一个妹子的问题 https://q.cnblogs.com/q/101462 下载js包 http://www.layui.com/laydate/ 将laydate下载的包解压放入sta ...
- Money型字段小数点后保留两位小数
asp.net直接显示Money型字段小数点后面将保留四位小数,而我们常见的格价显示一般是小数点后两位,如何实现这种效果呢,有如下几种方法: 1.直接型,通过ToString()函数直接格式话 例如把 ...
- 原生js--insertAdjacentHTML
insertAdjacentHTML是IE浏览器提供向DOM中插入html字符串的方法,字符串会自动生成在DOM树中. 其调用方式为elem.insertAdjacentHTML( position, ...
- [Offer收割]编程练习赛13 B.最大子矩阵[枚举]
#1502 : 最大子矩阵 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定一个NxM的矩阵A和一个整数K,小Hi希望你能求出其中最大(元素数目最多)的子矩阵,并且该 ...