Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

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.

share|improve this answer
add comment

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
add comment

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.