Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 8 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.

share|improve this answer
    
Any proof from official document ? – wener Nov 2 '14 at 11:27

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .