对miek这个账号localhost 授予了所有库,所表的select权限

  1. mysql> grant select on *.* to 'mike'@'localhost';
  2. Query OK, 0 rows affected (0.00 sec)
  1. mysql> exit
  2. Bye
  3. [root@mysql ~]# mysql -umike -p123
  4. Warning: Using a password on the command line interface can be insecure.
  5. Welcome to the MySQL monitor. Commands end with ; or \g.
  6. Your MySQL connection id is 4
  7. Server version: 5.6.36 Source distribution
  8.  
  9. Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  10.  
  11. Oracle is a registered trademark of Oracle Corporation and/or its
  12. affiliates. Other names may be trademarks of their respective
  13. owners.
  14.  
  15. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  16.  
  17. mysql>
  18. mysql> show databases;
  19. +--------------------+
  20. | Database |
  21. +--------------------+
  22. | information_schema |
  23. | company |
  24. | db1 |
  25. | db2 |
  26. | db3 |
  27. | db4 |
  28. | db5 |
  29. | db6 |
  30. | mysql |
  31. | performance_schema |
  32. | test |
  33. | test2 |
  34. | test_1 |
  35. +--------------------+
  36. 13 rows in set (0.04 sec)
  37.  
  38. mysql> use db1;
  39. Reading table information for completion of table and column names
  40. You can turn off this feature to get a quicker startup with -A
  41.  
  42. Database changed
  43. mysql> show tables;
  44. +---------------+
  45. | Tables_in_db1 |
  46. +---------------+
  47. | innodb__t_t1 |
  48. | innodb__t_t2 |
  49. | innodb__t_t3 |
  50. | innodb__t_t4 |
  51. | t1 |
  52. | t3 |
  53. +---------------+
  54. 6 rows in set (0.00 sec)
  55.  
  56. mysql> select * from t1;
  57. +------+------+--------+------+
  58. | id | name | sex | age |
  59. +------+------+--------+------+
  60. | 1 | mike | male | 15 |
  61. | 2 | alex | female | 16 |
  62. | 3 | NULL | NULL | NULL |
  63. | 4 | NULL | NULL | NULL |
  64. +------+------+--------+------+
  65. 4 rows in set (0.01 sec)
  66.  
  67. mysql> desc t1;
  68. +-------+-----------------------+------+-----+---------+-------+
  69. | Field | Type | Null | Key | Default | Extra |
  70. +-------+-----------------------+------+-----+---------+-------+
  71. | id | int(11) | YES | | NULL | |
  72. | name | varchar(50) | YES | | NULL | |
  73. | sex | enum('male','female') | YES | | NULL | |
  74. | age | int(4) | YES | | NULL | |
  75. +-------+-----------------------+------+-----+---------+-------+
  76. 4 rows in set (0.00 sec)
  77.  
  78. mysql> insert into t1 values(5,'jack','male',50);
  79. ERROR 1142 (42000): INSERT command denied to user 'mike'@'localhost' for table 't1'

没有插入记录权限,只有select权限

mysql 权限管理 对所有库 所有表 授权 *.*的更多相关文章

  1. mysql 权限管理 针对某个库 某张表 授权 tables_priv表

    精确到表级别 针对db1的t3表 授予select权限 mysql> grant select on db1.t3 to 'mike'@'localhost'; Query OK, rows a ...

  2. mysql 权限管理 针对表的字段 级别 授权 columns_priv表

    针对Mike账号 db1库下面的t1表的 id,name字段授予select权限,age字段授予update权限 授权格式 select(要授权的字段,要授权的字段) 用户括号 括起来  .updat ...

  3. mysql 权限管理 目录

    mysql 权限管理介绍 mysql 权限管理 记录 mysql 权限管理 grant 命令 mysql 权限管理 revoke 回收权限 命令 mysql 权限管理 针对库 授权 db.* mysq ...

  4. mysql 权限管理介绍

    mysql权限管理 就是对控制用户对库.对表的权限.对表中字段权限 权限管理分步 1.创建账号 创建账号有本地账号和远程账号 本地账号 本地账号只能在mysql服务端机器做操作 '; # mysql ...

  5. MySQL权限管理、配置文件(三)

    一.MySQL权限管理 GRANT 权限 ON 授权范围 TO '用户名'@'允许的ip(所有%)' IDENTIFIED BY '用户密码'; 权限:参加下表,一般常用的是CREATE.DELETE ...

  6. mysql权限管理命令示例

    mysql权限管理命令示例 grant all privileges on *.* to *.* identified by 'hwalk1'; flush privileges; insert in ...

  7. mysql 权限管理 针对库 授权 db.*

    需求 只放行user表 db1库的select权限 mysql> grant select on db1.* to 'mike'@'localhost'; Query OK, rows affe ...

  8. mysql权限管理

    经常遇到有网友在QQ群或者论坛上问关于mysql权限的问题,今天抽空总结一下关于这几年使用MYSQL的时候关于MYSQL数据库的权限管理的经验,也希望能对使用mysql的网友有所帮助! 一.MYSQL ...

  9. mysql 权限管理

     参考:    http://www.cnblogs.com/Richardzhu/p/3318595.html 一.MySQL权限简介 关于mysql的权限简单的理解就是mysql允许你做你全力以内 ...

随机推荐

  1. java 递归

    package com.j1.soa.resource.cms.service.oracle; import com.j1.base.dto.ServiceMessage; import com.j1 ...

  2. 两台Linux主机互传文件可以使用SCP命令来实现

    当两台linux主机之间要互传文件时可使用SCP命令来实现 复制文件: (1)将本地文件拷贝到远程 scp 文件名 --用户名@计算机IP或者计算机名称:远程路径 (2)从远程将文件拷回本地 scp ...

  3. log4net日志的简单配置

    说起来log4net,我一直都知道这个的存在,但实际在项目中还真是没有去自己写过的那,这一次我在项目完成后并没有着急下一个项目的开始,于是突然想起来是否添加一个日志的编写,于是开始了log4net的总 ...

  4. Mac下Intellij IDea发布JavaWeb项目 详解三 (为所有Module配置Tomcat Deployment 并测试web 网页 配置Servlet)

    step4 为所有项目配置Deployment 4.1 如图 4.2 [+][Artifact] 4.3 将这里列出的所有内容选中后,点[OK] 4.4 选完是这样,表示,这三个java ee 项目会 ...

  5. JS动态设置确认弹窗

    多次使用确认弹窗 <!--START 确认收货--> <div class="popout-boxbg out" id="delivery_goods& ...

  6. Writing Reentrant and Thread-Safe Code(译:编写可重入和线程安全的代码)

    Writing Reentrant and Thread-Safe Code 编写可重入和线程安全的代码 (http://www.ualberta.ca/dept/chemeng/AIX-43/sha ...

  7. 【vue学习】vue中怎么引用laydate.js日期插件

    此贴意在解决一个妹子的问题 https://q.cnblogs.com/q/101462 下载js包 http://www.layui.com/laydate/ 将laydate下载的包解压放入sta ...

  8. Money型字段小数点后保留两位小数

    asp.net直接显示Money型字段小数点后面将保留四位小数,而我们常见的格价显示一般是小数点后两位,如何实现这种效果呢,有如下几种方法: 1.直接型,通过ToString()函数直接格式话 例如把 ...

  9. 原生js--insertAdjacentHTML

    insertAdjacentHTML是IE浏览器提供向DOM中插入html字符串的方法,字符串会自动生成在DOM树中. 其调用方式为elem.insertAdjacentHTML( position, ...

  10. [Offer收割]编程练习赛13 B.最大子矩阵[枚举]

    #1502 : 最大子矩阵 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定一个NxM的矩阵A和一个整数K,小Hi希望你能求出其中最大(元素数目最多)的子矩阵,并且该 ...