Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have configured my MySQL Database to require passwords on all users, even root from the machine itself.

Now I discovered that there are empty Users in my Database

Reproduce: mysql -u root -p and then use mysql; & select * from user;

it gives me 2 entries, one with "localhost" and user and one with the machine's hostname and .

now i tried to access the account with mysql -u ' ' (yes it's correct, leave a space between the ' things) and I log in without a password. The user can "only" see information_schema and test, the two databases created by default. He does not has access to mysql or any other custom created databases.

I already changed the Password of this user to something I won't tell you mysql -u root -p use mysql; UPDATE mysql.user SET Password=PASSWORD('thisisasecretpassword') WHERE USER='root'; FLUSH PRIVILEGES;

but yeah now my Question:

Is any MySQL Server vulnerable for an attack with this entry?

Could an attacker break out of this account or the two default databases?

Should I password-protect those Users or can I delete them? Are They required for some MySQL-internal things?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Those are anonymous users and, as such, don't need passwords. They are created by default on all installations. I'm not sure why it's done this way.

You can either set a password for them or remove them. From https://dev.mysql.com/doc/refman/5.6/en/default-privileges.html:

If you want to prevent clients from connecting as anonymous users without a password, you should either assign a password to each anonymous account or else remove the accounts.

Seems to be a duplicate of this one: MySQL 5.5.16 allows anonymous connections

share|improve this answer
    
Thank you for the Link, didn't find it myself ;) By the way, are there more things like that (which I need to take care of) for MySQL? –  v3nd3tta Nov 28 '12 at 13:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.