Accept remote connection from your website to your MySQL server (safe way)

Have you created a useful tool? or Do you want to get help building one? This is the right place!
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
regenx
Posts: 319
Joined: Sat Jul 17, 2010 6:55 am

Accept remote connection from your website to your MySQL server (safe way)

Post by regenx »

Use this rules:
UFW rule:

Code: Select all

sudo ufw allow from XXX.XXX.XX.XXX to any port 3306
IPTables rule:

Code: Select all

iptables -A INPUT -p tcp --dport 3306 -s XXX.XXX.XX.XXX -j ACCEPT
where XXX.XXX.XX.XXX is your IP from external web server (where your website is hosted).
JMD
Advanced User
Advanced User
Posts: 1440
Joined: Wed Apr 15, 2009 10:07 am

Re: Accept remote connection from your website to your MySQL server (safe way)

Post by JMD »

Thanks. :+1:
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Accept remote connection from your website to your MySQL server (safe way)

Post by Attila »

regenx wrote: Wed Aug 30, 2017 4:52 pm Use this rules:
UFW rule:

Code: Select all

sudo ufw allow from XXX.XXX.XX.XXX to any port 3306
IPTables rule:

Code: Select all

iptables -A INPUT -p tcp --dport 3306 -s XXX.XXX.XX.XXX -j ACCEPT
where XXX.XXX.XX.XXX is your IP from external web server (where your website is hosted).
Where should I look to adjust this :eh:

thanks
JMD
Advanced User
Advanced User
Posts: 1440
Joined: Wed Apr 15, 2009 10:07 am

Re: Accept remote connection from your website to your MySQL server (safe way)

Post by JMD »

Attila wrote: Sat Sep 02, 2017 1:15 pm
regenx wrote: Wed Aug 30, 2017 4:52 pm Use this rules:
UFW rule:

Code: Select all

sudo ufw allow from XXX.XXX.XX.XXX to any port 3306
IPTables rule:

Code: Select all

iptables -A INPUT -p tcp --dport 3306 -s XXX.XXX.XX.XXX -j ACCEPT
where XXX.XXX.XX.XXX is your IP from external web server (where your website is hosted).
Where should I look to adjust this :eh:

thanks
its commands you type on putty or command line prompt on a linux server. Logicaly you can reverse them by typing the opposite. example instead of ACCEPT use DROP.
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Accept remote connection from your website to your MySQL server (safe way)

Post by Attila »

Oke this is only for linux server

Thanks for the reply
User avatar
regenx
Posts: 319
Joined: Sat Jul 17, 2010 6:55 am

Re: Accept remote connection from your website to your MySQL server (safe way)

Post by regenx »

Attila wrote: Sun Sep 03, 2017 7:27 am Oke this is only for linux server

Thanks for the reply
Yes, for Linux Debian based.
Do you know another server OS? :)
Windows Server is NOT a server! Do not use Windows Server, it is Windows OS and that's all.


@JWD
Why reverse with DROP? There is "sudo ufw allow" (for DROP is different). This case is ONLY when you need to allow special IP's but in other case when you don't need .. you better DENY to be sure :)
Sacrifice
Advanced User
Advanced User
Posts: 1026
Joined: Thu Aug 14, 2014 6:31 am

Re: Accept remote connection from your website to your MySQL server (safe way)

Post by Sacrifice »

regenx wrote: Wed Aug 30, 2017 4:52 pm Use this rules:
UFW rule:

Code: Select all

sudo ufw allow from XXX.XXX.XX.XXX to any port 3306
IPTables rule:

Code: Select all

iptables -A INPUT -p tcp --dport 3306 -s XXX.XXX.XX.XXX -j ACCEPT
where XXX.XXX.XX.XXX is your IP from external web server (where your website is hosted).
As long as the hosting (free in my case), do not have that port closed (which I do not understand since the database server is another server than the hosting) and pretend to charge you for it (like me). Truth hostinger.es ?.
Sacrifice
Advanced User
Advanced User
Posts: 1026
Joined: Thu Aug 14, 2014 6:31 am

Re: Accept remote connection from your website to your MySQL server (safe way)

Post by Sacrifice »

Or for php fsockopen() command, to check two simple ports, to be locked... Real hostinger.es?
User avatar
regenx
Posts: 319
Joined: Sat Jul 17, 2010 6:55 am

Re: Accept remote connection from your website to your MySQL server (safe way)

Post by regenx »

I do not understand you. What do you need to know?
I don't know hostinger.es and I don't care about hosting companies, this thread is not about hosting companies.
Sacrifice
Advanced User
Advanced User
Posts: 1026
Joined: Thu Aug 14, 2014 6:31 am

Re: Accept remote connection from your website to your MySQL server (safe way)

Post by Sacrifice »

:think: :wtf: I'm not need to know nothing... for now at least... :lolno:
Post Reply