Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Apr 08, 2012 6:45 pm 
Offline
Senior Newbie

Joined: Sat Nov 26, 2011 11:35 pm
Posts: 14
I wanted to be able to access my mysql database with a remote client. (SQLYog)
I googled for how to enable remote connections and updated my IPTables.
However, now my site is having a hard time refreshing, I run CodeIgniter and on every 5th to 6th refresh, I get can't establish database connection.

I have a novice understanding of IPTables and I'm just not sure where I screwed this one up.

iptables -L

Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:mysql

Chain FORWARD (policy DROP)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

-------------------------------------

for those who know CodeIgniter

Unable to connect to your database server using the provided settings.

Filename: core/Loader.php

Line Number: 346


Thanks,


Top
   
 Post subject:
PostPosted: Sun Apr 08, 2012 6:50 pm 
Offline
Senior Member

Joined: Mon Aug 29, 2011 2:34 am
Posts: 77
Could you provide the output of the following commands?

Code:
iptables-save
netstat -plant | grep 3306


iptables -L isn't very useful, as it omits some info, and makes other things more effort to understand what is actually going on


Top
   
 Post subject:
PostPosted: Sun Apr 08, 2012 7:11 pm 
Offline
Senior Newbie

Joined: Sat Nov 26, 2011 11:35 pm
Posts: 14
dwfreed wrote:
Could you provide the output of the following commands?

Code:
iptables-save
netstat -plant | grep 3306


iptables -L isn't very useful, as it omits some info, and makes other things more effort to understand what is actually going on



I use a Editor for php programming and the refreshes seem less likely to happen after I make some code changes and click save, rather then just hitting refresh on the browser.
So I'll make a code change, click save, hit refresh about 6 times then it works, if I don't mess with the editor, and just pound refresh it works ever time.



# Generated by iptables-save v1.4.7 on Sun Apr 8 19:07:32 2012
*security
:INPUT ACCEPT [36656:3526692]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [39079:11623693]
COMMIT
# Completed on Sun Apr 8 19:07:32 2012
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:07:32 2012
*raw
:PREROUTING ACCEPT [36669:3527649]
:OUTPUT ACCEPT [39080:11623849]
COMMIT
# Completed on Sun Apr 8 19:07:32 2012
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:07:32 2012
*nat
:PREROUTING ACCEPT [2033:107397]
:INPUT ACCEPT [2024:106608]
:OUTPUT ACCEPT [9621:677265]
:POSTROUTING ACCEPT [9621:677265]
COMMIT
# Completed on Sun Apr 8 19:07:32 2012
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:07:32 2012
*mangle
:PREROUTING ACCEPT [36669:3527649]
:INPUT ACCEPT [36669:3527649]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [39086:11624897]
:POSTROUTING ACCEPT [39086:11624897]
COMMIT
# Completed on Sun Apr 8 19:07:32 2012
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:07:32 2012
*filter
:INPUT DROP [13:957]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [39088:11625193]
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
COMMIT
# Completed on Sun Apr 8 19:07:32 2012


Top
   
 Post subject:
PostPosted: Sun Apr 08, 2012 7:56 pm 
Offline
Senior Newbie

Joined: Sat Nov 26, 2011 11:35 pm
Posts: 14
zobrak wrote:
dwfreed wrote:
Could you provide the output of the following commands?

Code:
iptables-save
netstat -plant | grep 3306


iptables -L isn't very useful, as it omits some info, and makes other things more effort to understand what is actually going on



I use a Editor for php programming and the refreshes seem less likely to happen after I make some code changes and click save, rather then just hitting refresh on the browser.
So I'll make a code change, click save, hit refresh about 6 times then it works, if I don't mess with the editor, and just pound refresh it works ever time.


SYSTEM 2
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:07:32 2012
*security
:INPUT ACCEPT [36656:3526692]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [39079:11623693]
COMMIT
# Completed on Sun Apr 8 19:07:32 2012
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:07:32 2012
*raw
:PREROUTING ACCEPT [36669:3527649]
:OUTPUT ACCEPT [39080:11623849]
COMMIT
# Completed on Sun Apr 8 19:07:32 2012
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:07:32 2012
*nat
:PREROUTING ACCEPT [2033:107397]
:INPUT ACCEPT [2024:106608]
:OUTPUT ACCEPT [9621:677265]
:POSTROUTING ACCEPT [9621:677265]
COMMIT
# Completed on Sun Apr 8 19:07:32 2012
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:07:32 2012
*mangle
:PREROUTING ACCEPT [36669:3527649]
:INPUT ACCEPT [36669:3527649]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [39086:11624897]
:POSTROUTING ACCEPT [39086:11624897]
COMMIT
# Completed on Sun Apr 8 19:07:32 2012
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:07:32 2012
*filter
:INPUT DROP [13:957]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [39088:11625193]
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
COMMIT
# Completed on Sun Apr 8 19:07:32 2012



-------------------------------------------------------------------------------------------------------
Here is another Linode I have ... running about the system that works.
I'm not sure what of those lines at the bottom I need for previous system to stop having so many errors.


SYSTEM 1
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:52:50 2012
*security
:INPUT ACCEPT [12826672:7758787170]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [10947027:2016195081]
COMMIT
# Completed on Sun Apr 8 19:52:50 2012
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:52:50 2012
*raw
:PREROUTING ACCEPT [12853817:7760185297]
:OUTPUT ACCEPT [10947027:2016195081]
COMMIT
# Completed on Sun Apr 8 19:52:50 2012
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:52:50 2012
*nat
:PREROUTING ACCEPT [291780:16679014]
:INPUT ACCEPT [268140:15459913]
:OUTPUT ACCEPT [1091234:74705149]
:POSTROUTING ACCEPT [1091234:74705149]
COMMIT
# Completed on Sun Apr 8 19:52:50 2012
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:52:50 2012
*mangle
:PREROUTING ACCEPT [12853817:7760185297]
:INPUT ACCEPT [12853817:7760185297]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [10947027:2016195081]
:POSTROUTING ACCEPT [10947027:2016195081]
COMMIT
# Completed on Sun Apr 8 19:52:50 2012
# Generated by iptables-save v1.4.7 on Sun Apr 8 19:52:50 2012
*filter
:INPUT DROP [14622:732886]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [7751339:1320739070]
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT
COMMIT
# Completed on Sun Apr 8 19:52:50 2012


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
RSS

Powered by phpBB® Forum Software © phpBB Group