After MySQL is installed, a root user and an anonymous user will be automatically created, which is ignored by many users, this is probably because anonymous users are set to be only available locally by default.
However, if MySQL is to be used as a database for Web servers, it may be costly to ignore this anonymous user. By default, this anonymous user has almost the same permissions as root on localhost. It is very likely that a visitor uploads a PHP file, creates a new user with this PHP file, gives him a higher permission, and then uses this new user to connect to the MySQL server, manage the MySQL of the server.
The DELETE command is as follows:
MySQL> UPDATE user set password = PASSWORD ('your password') where user = '';
MySQL> flush privileges;
The preceding section describes how to delete an anonymous mysql user from the help website. We hope this will help you.