How MySQL removes anonymous users (improves security)

Source: Internet
Author: User

the detailed steps for removing anonymous users in MySQL are as follows:

[[Email protected] ~] #mysql-u root-p← log in with root via password
Enter password:← the password here

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; ← Viewing user Information
+------+----------------------------+
| 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= '; ← Deleting anonymous users
Query OK, 2 rows affected (0.17 sec)

Mysql> select User,host from Mysql.user; ← Viewing user Information
+------+----------------------------+
| user | Host |
+------+----------------------------+
| Root | localhost |
| Root | sample.centospub.com |
+------+----------------------------+
2 rows in Set (0.00 sec)

mysql> exit← exit MySQL server
Bye

This article from the "12259248" blog, reproduced please contact the author!

How MySQL removes anonymous users (improves security)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.