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 have looked at this Post and it details how you can allow a connection from a remote host to the database. But the line that took me off guard was this:

mysql> GRANT ALL PRIVILEGES ON *.* TO user@50.xx.xx.xx IDENTIFIED BY "pass";.

It looks like you have to grant permissions to each remote client that wants to access the database?

What if I want to allow all remote clients to be able to access the database? How can this be done instead of having to identify each one.

share|improve this question
up vote 4 down vote accepted

Using wildcards for the host part.

mysql> GRANT ALL PRIVILEGES ON *.* TO 'user@50.xx.xx.%' IDENTIFIED BY "pass";
mysql> GRANT ALL PRIVILEGES ON *.* TO 'user@%' IDENTIFIED BY "pass";

Be careful though, this is dangerous.

share|improve this answer
Thanks! This might be a dumb question, but what is the "pass" part of the statement do? Is this my password for root? – user489041 Oct 4 '11 at 17:10
Also, does using user@% allow for all users? It doesnt need to be roo@% or anything, right? – user489041 Oct 4 '11 at 17:14
The pass option is the password for the user user coming from this specified host. This can be different depending on from where you connect. And no, user@% is valid only for the user user, but coming from everywhere. MySQL explicitly disallow wildcards for users, so the form %@% is not possible. – Sven Oct 4 '11 at 17:30

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.