How to delete anonymous users in MYSQL

Source: Internet
Author: User


Delete anonymous users. After MySQL is installed, users with empty usernames and passwords are deleted. This makes it possible for the database server to be logged on without a password. Delete anonymous users to eliminate potential risks. [Root @ sample ~] # Mysql-u root-p login Enter password with the password root: Login here Enter the password Welcome to the MySQL monitor. commands end with; or \ g. your MySQL connection id is 7 to server version: 4.1.20Type 'help; 'or' \ H' for help. type '\ C' to clear the buffer. mysql> select user, host from mysql. user; users viewing user information + ------ + users + www.2cto.com | user | host | + ------ + users + | localhost | root | localhost | sample.centospub.com | root | sample.centospub.com | + ------ + ---------------------------- + 4 rows in set (0.02 sec) mysql> delete from mysql. user where user = ''; explain Delete anonymous user Query OK, 2 rows affected (0.17 sec) mysql> select user, host from mysql. user; users view user Information + ------ + -------------------------- + | user | host | + ------ + Principal + | root | localhost | root | sample.centospub.com | + ------ + Principal + author Yi Meng

Related Article

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.