国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

Mysql下查看用戶數據庫的實例

2024-07-24 12:35:26
字體:
來源:轉載
供稿:網友
  在mysql中要查看用戶名與數據庫我們可以在mysql命令模式下直接使用相關的命令就可以查了,具體的小編就為各位介紹一下吧.
 
  命令行下查看用戶、數據庫:
 
  mysql> use gbk    #進入gbk數據庫
  Database changed
  mysql> show tables;    #查看gbk數據庫的所有表
  Empty set (0.00 sec)
  mysql> use ultrax;
  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;
  mysql> show tables from ultrax;    #查看ultrax數據庫的數據表[mysql> show tables in ultrax;]
  +-----------------------------------+
  | Tables_in_ultrax                  |
  +-----------------------------------+
  | pre_common_admincp_cmenu          |
  | pre_common_admincp_group          |
  …………………………………省略部分內容………………………………
  | pre_ucenter_tags                  |
  | pre_ucenter_vars                  |
  +-----------------------------------+
  293 rows in set (0.01 sec)
  mysql> use gbk
  Database changed
  mysql> select database();
  +------------+
  | database() |
  +------------+
  | gbk        |
  +------------+
  1 row in set (0.00 sec)
  mysql> select user,host from mysql.user;    #查看用戶、主機
  +------+-----------+
  | user | host      |
  +------+-----------+
  | root | 127.0.0.1 |
  | root | ::1       |
  |      | lamp      |
  | root | lamp      |
  |      | localhost |
  | root | localhost |
  +------+-----------+
  6 rows in set (0.06 sec)
  mysql> drop user ''@'localhost';    #刪除用戶名為空,主機名為localhost
  mysql> drop user ''@'lamp';    #刪除主機名為lamp,用戶名為空
  Query OK, 0 rows affected (0.09 sec)
  mysql> select user,host from mysql.user;    #查看是否刪除成功
  +------+-----------+  --phpfensi.com
  | user | host      |
  +------+-----------+
  | root | 127.0.0.1 |
  | root | ::1       |
  |      | lamp      |
  | root | lamp      |
  | root | localhost |
  +------+-----------+
  5 rows in set (0.00 sec)
  mysql> delete from mysql.user where user='' and host='lamp';#如果無法刪除的可以采用類似此種的方法進行刪除.
 
  mysql> flush privileges;。
 
 

(編輯:武林網)

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 惠东县| 河北区| 隆昌县| 都匀市| 米脂县| 奉贤区| 若尔盖县| 疏勒县| 广南县| 乾安县| 新邵县| 邯郸县| 墨脱县| 承德市| 阳曲县| 淄博市| 湖北省| 自贡市| 万宁市| 沁阳市| 神池县| 新源县| 邻水| 大姚县| 大同县| 白朗县| 建阳市| 麦盖提县| 岳阳市| 汉寿县| 额济纳旗| 青田县| 郎溪县| 连江县| 阳泉市| 阳江市| 乌苏市| 房山区| 调兵山市| 贵州省| 潮州市|