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允许你做你全力以内 ...
随机推荐
- 客户端远程连接linux下mysql数据库授权
mysql默认状态是只支持localhost连接,这样远程服务器都输入IP地址去连接你的服务器是不可以的,下面我来介绍怎么让mysql允许远程连接配置方法,有需要的朋友可参考. 方法一,直接利用p ...
- iOS - 实现语言本地化/国际化
实现iOS语言本地化/国际化(图文详解) 前言 语言本地化,又叫做语言国际化.是指根据用户操作系统的语言设置,自动将应用程序的语言设置为和用户操作系统语言一致的语言.往往一些应用程序需要提供给多个 ...
- android R文件不能识别?
android R文件引入不了原因可能是: 1.xml有错误,导致R文件生成失败:(修改xml,并clear,然后再重新Bulid一下即可) 2.如果是图片,可能是命名有问题,查看并修改(不要以数字开 ...
- 【前端开发】 JS面试题整理
1.截取字符串abcdace的acealert('abcdace'.substring(4)); 2.规避javascript多人开发函数重名问题命名空间封闭空间js模块化mvc(数据层.表现层.控制 ...
- smarty assign变量赋值
1.变量赋值的两种写法 <%assign var="name" value="cl"%> <%assign "name" ...
- Android 反编译Apk提取XML文件
Apktool https://ibotpeaches.github.io/Apktool/install/ 下载地址:Apktool https://bitbucket.org/iBotPeache ...
- LeetCode 19 Remove Nth Node From End of List (移除距离尾节点为n的节点)
题目链接 https://leetcode.com/problems/remove-nth-node-from-end-of-list/?tab=Description Problem: 移除距离 ...
- Linux mint 亮度调节
刚装上的mint亮度严重影响操作,快速调节mint亮度的方法 echo 1000 >/sys/class/backlight/intel_backlight/brightness 1000这个数 ...
- CentOS 安装Passenger
gem install passenger 查看路径 passenger-config --root passenger-install-apache2-module ps auxw | grep f ...
- iOS - UIScreen的 bound、frame、scale属性
A UIScreen object contains the bounding rectangle of the device’s entire screen. When setting up you ...