Why does any user name have access to the test database under MySQL?

Source: Internet
Author: User

Today, we suddenly find that local MySQL can access two of these databases through any user name.

One: Any user name can be accessed to these two databases
Second: User name at will to write, as long as the password is not written can be accessed, but after writing it will not be successful login

Add:
The above is yesterday's question, today I went to log in when I found that the non-existent user name can not login, how so strange? Why did you do it yesterday?

Add a note:
Now that the problem has been solved, it is a small mistake made by yourself:
One is the empty username, is any user name can be accessed, I have always thought that the corresponding empty user name is right, in fact, is not so;
Second, it is the corresponding password is empty, so, I lost the password can not login;
Third, I deleted the empty user name after the user or this, because there is no restart MySQL!!!! (Alas, I found that I had made several such mistakes!) )
Today, after opening the computer, found "normal", because the computer "restarted"!

Reply content:

Today, we suddenly find that local MySQL can access two of these databases through any user name.

One: Any user name can be accessed to these two databases
Second: User name at will to write, as long as the password is not written can be accessed, but after writing it will not be successful login

Add:
The above is yesterday's question, today I went to log in when I found that the non-existent user name can not login, how so strange? Why did you do it yesterday?

Add a note:
Now that the problem has been solved, it is a small mistake made by yourself:
One is the empty username, is any user name can be accessed, I have always thought that the corresponding empty user name is right, in fact, is not so;
Second, it is the corresponding password is empty, so, I lost the password can not login;
Third, I deleted the empty user name after the user or this, because there is no restart MySQL!!!! (Alas, I found that I had made several such mistakes!) )
Today, after opening the computer, found "normal", because the computer "restarted"!

You look at the user right of the test database, which is allowed to be accessed by any user.

Log in with the root account, and then

select * from mysql.user \G

See if there are two columns of user that are empty. That is, any user.

As Justjavac said, the test database permissions are completely open, so there is a certain risk, online database use is likely to be deleted from this library ~

  • 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.