MySQL Forums
Forum List  »  Newbie

Re: IP Restriction
Posted by: Barry Galbraith
Date: August 15, 2014 11:42PM

I'm not sure you've asked the correct question, but I'll answer what you've asked.
Create a user@host where the host is the ip address or network you want to allow.

e.g
GRANT INSERT, UPDATE, SELECT DELETE on *.my_db to 'user'@'10.0.0.1' IDENTIFIED by 'your_password';
FLUSH PRIVILEGES;
Gives you one user at machine 10.0.0.1

or
code]
GRANT INSERT, UPDATE, SELECT, DELETE on *.my_db to 'user'@'10.0.0.%' IDENTIFIED by 'your_password';
FLUSH PRIVILEGES;
[/code]
Gives you one user on any machine 10.0.0.1 to 10.0.0.254.

See the refman.
http://dev.mysql.com/doc/refman/5.6/en/user-account-management.html

But if you want restrict users of YOUR APPLICATION which then uses mysql, then that is up to your application, and is a whole other kettle of fish. You'll need to google "php secure login" or something like that.

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
August 15, 2014 06:08AM
Re: IP Restriction
August 15, 2014 11:42PM
August 16, 2014 02:18AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.