Server Fault is a question and answer site for system and network administrators. 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'd like to create a new user in mysql which will be able to connect only from my servers. I've seen a way to do it through IP ranges or domain names (e.g. CREATE USER 'repl'@'' IDENTIFIED BY 'slavepass'; )

Can I somehow (by changing hostnames, hosts files or such) define a domain of servers which talk to each other through this user, without involving a real DNS server?

share|improve this question

If you want to use names instead of IPs, you can use a DNS server which will resolve the names to IPs. Alternatively, you need to include the used names in the hosts file of each machine you want to be able to resolve these names.

If you have many names/machines, setting up a local DNS server can be easier than maintaining a long list of names in many hosts files located on many machines.

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.