Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 add a user on Application server using "useradd" command.

/usr/sbin/useradd shantanu

This user can connect to mysql service using the following command...

mysql -h -uroot -proot@123

I want this user to not to be able to connect to production mysql DB hosted on I could use firewall protection, but I do not have root access to I need some users to be able to connect to mysql hosted on 111 and some users should not be able to do so. Is there an easy way to do this apart from using jail ?

share|improve this question
up vote 2 down vote accepted

You should do it at MySQL level by granting privileges to the user who you want:

mysql> create user 'allow_user'@'application.server.IP' identified by 'pa$$word';
mysql> grant select, insert, ... on db.table to 'allow_user'@'application.server.IP';

share|improve this answer

jail would be a very odd way of going about this. Most people would simply not give out mysql usernames and passwords to those who did not need access to the mysql server.

share|improve this answer

Your Answer


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.