I am a user with sudo access. To install MySQL, I have to create an operating system (OS) user called MySQL. Can I create a user which also has sudo access on this machine?

  • Do not give the mysql user sudo access. If you read somewhere that you should do it, you probably misunderstood. – Gilles Apr 16 '14 at 22:08

The documented way to create the mysql account is:

groupadd mysql
useradd -r -g mysql mysql

Add the -m option if you want that account to be used as a login account, which looks to be the case.

If you have full sudo access, you can grant sudo rights to that use with using

sudo visudo

and adding a line similar the one starting with your username and replacing your username with mysql.

  • Does Operating system user and root user ( or user with sudo access) are same? – ursitesion Apr 16 '14 at 10:37
  • Operating System user is just used here to distinguish the account from a database account which is defined in a mysql table. An OS user is defined in /etc/passwd, a shared directory or similar. – jlliagre Apr 16 '14 at 11:20
  • root is a special OS user account with unlimited rights. – jlliagre Apr 16 '14 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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