mysql 权限管理 针对库 授权 db.*
需求 只放行user表 db1库的select权限
mysql> grant select on db1.* to 'mike'@'localhost';
Query OK, 0 rows affected (0.05 sec)
查看有没有记录
mysql> select * from mysql.db\G;

db1这个库下的所有表都可以查看select
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 6
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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| db1 |
| test |
| test_1 |
+--------------------+
4 rows in set (0.00 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>
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> 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> 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.00 sec) mysql> insert into t1 values(5,'jack','male',5);
ERROR 1142 (42000): INSERT command denied to user 'mike'@'localhost' for table 't1'
不能插入,只能查看
mysql 权限管理 针对库 授权 db.*的更多相关文章
- mysql 权限管理 针对某个库 某张表 授权 tables_priv表
精确到表级别 针对db1的t3表 授予select权限 mysql> grant select on db1.t3 to 'mike'@'localhost'; Query OK, rows a ...
- mysql 权限管理 目录
mysql 权限管理介绍 mysql 权限管理 记录 mysql 权限管理 grant 命令 mysql 权限管理 revoke 回收权限 命令 mysql 权限管理 针对库 授权 db.* mysq ...
- mysql 权限管理介绍
mysql权限管理 就是对控制用户对库.对表的权限.对表中字段权限 权限管理分步 1.创建账号 创建账号有本地账号和远程账号 本地账号 本地账号只能在mysql服务端机器做操作 '; # mysql ...
- Mysql——权限管理
安装Mysql时会自动安装一个名为mysql的数据库.这个数据库下面存储的是权限表. mysql> show databases; +--------------------+ | Databa ...
- 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权限管理
经常遇到有网友在QQ群或者论坛上问关于mysql权限的问题,今天抽空总结一下关于这几年使用MYSQL的时候关于MYSQL数据库的权限管理的经验,也希望能对使用mysql的网友有所帮助! 一.MYSQL ...
- mysql 权限管理
参考: http://www.cnblogs.com/Richardzhu/p/3318595.html 一.MySQL权限简介 关于mysql的权限简单的理解就是mysql允许你做你全力以内 ...
- MySQL权限管理实战
前言: 不清楚各位同学对数据库用户权限管理是否了解,作为一名 DBA ,用户权限管理是绕不开的一项工作内容.特别是生产库,数据库用户权限更应该规范管理.本篇文章将会介绍下 MySQL 用户权限管理相关 ...
随机推荐
- wireshark----linux
1.[root@lc~]# tshark Running as user "root" and group "root". This could be da ...
- java基础思维导图大全
- IDEA 单元测试 导入JUnit4到项目
一.IDEA自带JUnit4的jar包,现在让我们来导入. Step 1. IDEA最上面一栏的菜单栏中,选File->Project Structure(从上往下第11个),弹出窗口左边有一个 ...
- JavaScript 简介--对javascript的初识,最基础的了解
一.javascript的介绍 JavaScript是网景(Netscape)公司开发的一种基于客户端浏览器.面向(基于)对象.事件驱动式的网页脚本语言.JavaScript语言的前身叫作Livesc ...
- web应用安全防范(1)—为什么要重视web应用安全漏洞
现在几乎所有的平台都是依赖于互联网构建核心业务的. 自从XP年代开始windows自带防火墙后,传统的缓冲器溢出等攻击失去了原有威力,黑客们也把更多的目光放在了WEB方面,直到进入WEB2.0后,WE ...
- 二叉树的实现(Java语言描述)
实现二叉树 并先序遍历之. package 二叉树的实现; public class BinaryTree<T> { class Node { int value; // 该节点存储的 ...
- linux常用命令大全2--挂载/dpkg/文件系统分析/apt/光盘/关机
挂载一个文件系统 mount /dev/hda2 /mnt/hda2 挂载一个叫做hda2的盘 - 确定目录 '/ mnt/hda2' 已经存在 umount /dev/hda2 卸载一个叫做hda2 ...
- 移动设备 h5屏幕适配
<meta name="HandheldFriendly" content="true"><meta name="MobileOpt ...
- linux下MySQL安装及设置(二)
MySQL二进制分发包安装 去MySql官网下MySQL classic版mysql-5.6.30-osx10.11-x86_64.tar.gz http://dev.mysql.com/downl ...
- CentOS 6.8下Apache绑定多个域名的方法
如何通过设置Apache的http.conf文件,进行多个域名的绑定(假设我们要绑定的域名是discuz11.com和discuz22.com,独立IP为25.25.25.25). 域名/IP地址 域 ...