LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-07-2007, 04:05 PM   #1
unkie888
Member
 
Registered: Aug 2007
Posts: 67

Rep: Reputation: 26
Question mysql - iptables problem


I would like to connect to mysql running on computer B from computer A over the internet.

I think iptables is blocking the connection.

when iptables service is running and I try to connect from computer A;

[root@a ~]# mysql -h 89.xx.xx.xx -u root
ERROR 2003 (HY000): Can't connect to MySQL server on '89.xx.xx.x' (113)

but when i stop iptables and try again;

[root@a ~]# mysql -h 89.xx.xx.xx -u root
ERROR 1045 (28000): Access denied for user 'root'@'mydomain.co.uk' (using password: NO)

it looks like with iptables stopped it's getting through.

i have tried adding permission for port 3306, which is what i believe mysql uses;

[root@b ~]# iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT

but this makes no difference.

does anyone have any ideas - very much appreciated.



Computer B has FC6 2.6.18
[root@b ~]# mysql -V
mysql Ver 14.12 Distrib 5.0.22, for redhat-linux-gnu (x86_64) using readline 5.0
 
Old 09-07-2007, 04:20 PM   #2
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Rep: Reputation: 30
dont u need an output statement from source port 3306 as well?
 
Old 09-07-2007, 04:32 PM   #3
unkie888
Member
 
Registered: Aug 2007
Posts: 67

Original Poster
Rep: Reputation: 26
Got it. The ordering of the rules is important. I needed to make my rule first before the blocking rules. This makes it the first rule.

iptables -I INPUT 1 -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables Log Analyzer no logs in mysql db! abcampa Linux - Software 1 12-11-2008 03:53 AM
Bugzilla - MySQL - perl - DBD::mysql install problem amchargue Linux - Software 3 09-10-2008 01:01 AM
ULOG iptables Mysql gabsik Linux - Software 0 07-15-2006 10:24 AM
php-mysql dependancy problem after nitemare mysql upgrade. RHEL4 andrewc Red Hat 1 01-03-2006 05:16 PM
iptables trouble, LAN to MySQL on Firewall dwynter Linux - Security 3 11-01-2002 07:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration