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 [email protected] 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.

1 Answer 1


Using wildcards for the host part.

mysql> GRANT ALL PRIVILEGES ON *.* TO '[email protected].%' IDENTIFIED BY "pass";
mysql> GRANT ALL PRIVILEGES ON *.* TO 'user@%' IDENTIFIED BY "pass";

Be careful though, this is dangerous.

  • 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, 2011 at 17:10
  • Also, does using user@% allow for all users? It doesnt need to be roo@% or anything, right?
    – user489041
    Oct 4, 2011 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, 2011 at 17:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .