MySQL on two ports using IPTables - self-access

Posted by b0rman on Stack Overflow See other posts from Stack Overflow or by b0rman
Published on 2014-05-31T21:23:38Z Indexed on 2014/05/31 21:24 UTC
Read the original article Hit count: 135

Filed under:
|
|

I trying to make MySQL available by 2 ports: 3306 and 3339 I added rule to iptables:

iptables -t nat -A PREROUTING -i bond0 -p tcp --dport 3339 -j REDIRECT --to-port 3306

and everythin is great for remote connections. But if I'm trying to connect it locally, I'm getting an error:

mysql -u username -ppassword --port=3339 -h Host.Name ERROR 2003 (HY000): Can't connect to MySQL server on 'Host.Name' (111)

Any ideas how can I edit iptables to get local access via 3339 port?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about iptables