码迷,mamicode.com
首页 > 数据库 > 详细

MYSQL删除匿名用户的方法(提高安全性)

时间:2017-01-05 19:06:14      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:mysql删除匿名

mysql中删除匿名用户详细步骤如下:

[root@sample ~]#mysql -u root -p ← 通过密码用root登录
Enter password: ← 在这里输入密码

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 4.1.20

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the buffer.

mysql>select user,host from mysql.user;  ← 查看用户信息
+------+----------------------------+
| user | host         |
+------+----------------------------+
|   | localhost       |
| root | localhost       |
|   | sample.centospub.com |
| root | sample.centospub.com  |
+------+----------------------------+
4 rows in set (0.02 sec)

mysql> delete from mysql.user where user=‘‘;  ← 删除匿名用户
Query OK, 2 rows affected (0.17 sec)

mysql> select user,host from mysql.user;  ← 查看用户信息
+------+----------------------------+
| user | host         |
+------+----------------------------+
| root | localhost      |
| root | sample.centospub.com |
+------+----------------------------+
2 rows in set (0.00 sec)

mysql> exit  ← 退出MySQL服务器
Bye

本文出自 “12259248” 博客,转载请与作者联系!

MYSQL删除匿名用户的方法(提高安全性)

标签:mysql删除匿名

原文地址:http://12269248.blog.51cto.com/12259248/1889270

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!