I was told that mysql user, similar to root user, by default "has no password".

Not an empty password, but rather "no password". I wasn't aware this situation was possible - I thought every user on a linux had to have a password.

Am I wrong? Can you point me to a link that explain this?

link|improve this question

64% accept rate
feedback

2 Answers

up vote 7 down vote accepted

When you add a user in unix, ever notice how it doesn't prompt you for a password? Try it: useradd testuser. Didn't ask did it? Just gave you a new command prompt. Congratulations, now you have a user with no password.

Of course, you can't log in using the user until you set a password for it, so it's not much of a security hole. This is the reason the mysql user is set up with no password: if it HAD a default password it would be a MASSIVE security hole, because you'd be able to log in using that user and have rights over the database.

If you look in your /etc/shadow file, you should see the user with a ! where the password would otherwise be. Means the account is locked.

link|improve this answer
feedback

There are a number of users on a Linux system that are necessary for proper operation of the OS which are not meant to be logins. None of these should have a password.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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