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 ?
Asked
Active
Viewed 628 times
-1

Mohammad Bagher Saberi
- 99
- 1
- 3
- 9
-
1You need to read up on iptables and ow to use it. – user9517 Feb 01 '14 at 13:27
1 Answers
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,
-
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