MySQL操作許可權增刪改查

2021-07-31 04:52:02 字數 597 閱讀 8354

1、mysql操作許可權可檢視information_schema表;

2、cmd查詢當前使用者操作許可權命令: show grants; 

3、cmd查詢某某使用者操作許可權命令:show grants for username;

3、cmd**使用者操作許可權命令:revoke all privileges on *.* from user@'host';

4、cmd增加使用者操作許可權命令:

a、首先建立使用者:create user usernameidentified by 'password'; //identified by 將純文字密碼加密作為雜湊值儲存

b、grant all privileges on databasename.tablename(或者所有資料庫中的所有表*.*) to user@『host』;

5、cmd更新命令:flush  privileges;

注:host可使用ip、localhost、127.0.0.1、以及『%』符號,『%』符號代表所有;

注:任意操作之後想立即看到效果可即刻使用cmd更新命令;

注:host可使用ip、localhost、127.0.0.1、以及『%』符號,『%』符號代表所有;

MySQL 增刪改查操作

toc 登入資料庫 mysql u root p123456 建立資料庫 creat database test 檢視所有資料庫 show databases 檢視資料庫中所有的資料表 show tables 選中資料庫 usedatabases 建立資料表 create table pet nam...

MySQL增刪改查操作

增刪改查操作 查詢表中的所有的記錄 select from 表名 xs 建立資料庫 create database if not exists xsgl 8.2建立表 cerate table if not exists 判斷是否存在 表名 xsb 8.3刪除 drop database if ex...

mysql增刪改查效果 mysql增刪改查

檢視所有資料庫 mysql show databases 建立乙個庫ghd並指定字符集為utp8 mysql create database ghd charset utf8 檢視mysql支援的字符集 mysql show char set 建立乙個表,並設定id為主鍵 create table ...