MySQL – Allow connections from other IP or local network

March 11th, 2010 by admin Leave a reply »

To allow a connection to a MySQL db for a user from another source then localhost you would need to run the following:

GRANT ALL PRIVILEGES ON databasename TO username@''
 IDENTIFIED BY 'password';

Replace the required information with what you need( ie databasename, username, ip and password) but this will grant access to the db from that IP.

It is possible to use a wildcard for the IP OR domain ( can be or etc…). The wildcard is %. So the combination would be

192.168.1.% or 192.168.%.%

for a domain it is or %.sogoth.% etc....

Once added you then need to run:


This will allow the new user to connect to the proper DB.

if you found this helpful feel free to donate to:
ZEC: t1NQp1UuqQbmnXzazbLTSreS2AbaZpRBuTM
LTC: LZyNF1qkBUA7XFz83m5xwzGgmmj1owQn9d


  1. admin says:

    ya i forgot to add that part. Thanks for the reminder. Also added the need to flush privileges.

Leave a Reply

You must be logged in to post a comment.