找回密码
 注册
查看: 3110|回复: 0

数据库中user表中不需要的用户 drop,mysql

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2020-6-17 11:54:06 | 显示全部楼层 |阅读模式
mysql> select distinct concat('User: ''',user,'''@''',host,''';') as query from mysql.user;
  c; t2 T+ b4 q: q4 {3 b+---------------------------------+
! \( J! g' I# g8 }. q4 {/ A2 r| query                           |
/ M' }& V8 r0 M7 z: v6 [8 `% \+---------------------------------+) A4 t6 w) {! k6 V( n8 L' Q
| User: 'expiretest'@'%';         |
! q5 j) K, Y4 g: w" o| User: 'root'@'%';               |- c8 K6 P& p, ]0 a! A3 _( o, H
| User: 'ysw'@'%';                |
6 p& b# f  b7 z7 n# I| User: 'root'@'127.0.0.1';       |' ~2 X# L. n$ r9 `. J! i* X( s' f
| User: 'root'@'::1';             |3 N9 Y! U  y$ p" G
| User: ''@'centos6';             |
( w! O* O  H6 Y0 x4 u6 I| User: 'root'@'centos6';         |
' O2 W0 K0 Y) d' k# m/ p| User: ''@'localhost';           |
+ R* ]1 I8 a3 i; B% @0 P/ w| User: 'expiretest'@'localhost'; |
0 l0 |2 h+ E. P4 A* `( c6 F| User: 'root'@'localhost';       |
: ?) n$ R3 H# L3 N" b+---------------------------------+
1 t9 h- M+ A& q; G0 K" l10 rows in set (0.00 sec)
3 e; |4 ?. e/ H( I3 [+ X: K5 u
+ m9 K: l) D# J3 A* ^/ S* Gmysql> drop user 'root'@'z%';
8 K, l6 a1 W  J, L- X7 v8 rQuery OK, 0 rows affected (0.00 sec)! x' U, [1 h( u# R
# D' D; _- }1 Z( p# X! G( q

5 g7 i# u/ M* f! V4 E
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:24 , Processed in 0.018085 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表