---
title: "mysql 创建用户付权限"
author: "zqs520"
date: "2016-12-13T17:07:01Z"
tags: []
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2017-01-10T13:27:27Z"
id: 2344703
url: "https://zqs520.iteye.com/blog/2344703"
---

连接数据库
mysql -u root -p 回车    root为用户名

show databases;
use iot_yhgj
 
查看当前数据库
status




创建用户
 create user 'yhgj'@'%' identified by 'qh123456&*9';

授权
grant select on  iot_yhgj.last_tagdata to 'yhgj'@'%';
 flush privileges;//刷新系统权限表

收回权限
 revoke all privileges  on qeemdb.* from 'qeem'@'%';