Why can any user name access the test database in mysql?

Source: Internet
Author: User
Today, I suddenly found that the local mysql can access two of these databases using any user name. Why? 1. Any user name can access these two databases. 2. The user name can be written at will. As long as the password is not written, the user name cannot be successfully logged on...

Today, I suddenly found that the local mysql can access two of these databases using any user name. Why?

1. Any user name can access these two databases.
2. the user name can be accessed as long as the password is not written, but cannot be successfully logged on after it is written.

Supplement:
The above is a question from yesterday. When I log on again today, I find that a non-existent user name cannot be logged on. Why is it so strange? Why yesterday?

Additional instructions:
Now the problem has been solved, but I still make a small mistake:
First, if there is a blank user name, any user name can be accessed. I used to think that the corresponding empty user name is correct. In fact, this is not the case;
Second, the password corresponding to it is blank. Therefore, I cannot log on if I lose the password;
Third, this is the case after I delete the empty user name, because mysql is not restarted !!!! (Ah, I found several such mistakes !)
After I started my computer today, I found "normal" because the computer "restarted!

Reply content:

Today, I suddenly found that the local mysql can access two of these databases using any user name. Why?

1. Any user name can access these two databases.
2. the user name can be accessed as long as the password is not written, but cannot be successfully logged on after it is written.

Supplement:
The above is a question from yesterday. When I log on again today, I find that a non-existent user name cannot be logged on. Why is it so strange? Why yesterday?

Additional instructions:
Now the problem has been solved, but I still make a small mistake:
First, if there is a blank user name, any user name can be accessed. I used to think that the corresponding empty user name is correct. In fact, this is not the case;
Second, the password corresponding to it is blank. Therefore, I cannot log on if I lose the password;
Third, this is the case after I delete the empty user name, because mysql is not restarted !!!! (Ah, I found several such mistakes !)
After I started my computer today, I found "normal" because the computer "restarted!

You can see that the user permissions of the test Database allow access by any user.

Log On with the root account, and then

select * from mysql.user \G

Check whether the user with two columns is empty. That is, any user.

As justjavac said, the permissions of the test database are completely open, so there is a certain risk that online databases may be deleted manually ~

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.