-1

I have a CentOS VPS. Port #3306 for MySQL is open for all customers, and they can connect to their databases remotely. As this can be a cause of security issues, I would like to stop all remote connections to MySQL by default and let only some specific users to do that.
How can I do these through SSH ?

1 Answers1

0

I hope following option may help you,

GRANT ALL PRIVILEGES ON database.* TO 'user'@'%' IDENTIFIED BY 'userpassword';

For your reference please visit following url,

https://stackoverflow.com/questions/8348506/grant-remote-access-of-mysql-database-from-any-ip-address

Premjith
  • 82
  • 1
  • 2
  • 11
  • I've removed port 3306 from incoming connections. So what I need now is to allow port 3306 to be opened only for one database. Can you tell me any solution for this Premijith? – Mohammad Bagher Saberi Feb 01 '14 at 18:14
  • Hi Mohammad, Please check following url for the security aspects of mysql , http://www.myquerybuilder.com/help/howtosetupaconnection . we can use iptables rule for port wise access permissions,but that may be not useful for specific db access. so you can use iptable rule for particular ip restriction – Premjith Feb 03 '14 at 15:25