LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-06-2012, 08:52 AM   #1
snooze1
Member
 
Registered: Sep 2011
Posts: 34

Rep: Reputation: Disabled
Unhappy MySQL will not allow remote connections, iptables is disabled, CentOS 5.6.


When assigning a user from a remote IP to connect to a database it's not connecting at all, no error message, no DENIED, nothing. It is also failing to connect with root so something is wrong. Bind IP is set to the server IP, i have also tried taking it out still no dice, also tried disabling iptables, still no dice. Port 3306 is forwarded, so for now iptables is disabled.

I'm running on Centos 5.6, using phpmyadmin, but I have also tried to assign the user via the commandline and create a new database, still not working.

Been googling and troubleshooting for hours now.

I've also attempted to assign the database and user via commandline, didn't work.

This is a Virtual Machine running off of VirtualBox, but it's being hosted on a server with a /29 block IP allocation. I am using SSH to connect to it, it connects to the internet perfectly fine, as with 'telnet [serverip] 3306'.

I am banging my head on the table trying to figure out what is wrong, I have also disabled the firewall to ensure that that wasn't blocking the port.
 
Old 04-06-2012, 09:23 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
You mean you can telnet to port 3306 from a console on the same system? How about from a different host? Have you commented out "skip-networking" in my.cnf?

Last edited by Ser Olmy; 04-06-2012 at 09:24 AM.
 
Old 04-06-2012, 09:27 AM   #3
snooze1
Member
 
Registered: Sep 2011
Posts: 34

Original Poster
Rep: Reputation: Disabled
Skip networking isn't in the my.cnf.

and the telnet was from the actual VM.
 
Old 04-06-2012, 09:30 AM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Then I guess netstat -pln | grep 3306 will show the mysqld process.

Does the VM have a public IP address, or is it NATed and the port forwarded via a router or firewall?

If you're using VirtualBox as a NAT router, any portforwarding will probably have to be performed by VirtualBox, not iptables.

Last edited by Ser Olmy; 04-06-2012 at 09:51 AM.
 
Old 04-06-2012, 09:54 AM   #5
snooze1
Member
 
Registered: Sep 2011
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
Then I guess netstat -pln | grep 3306 will show the mysqld process.

Does the VM have a public IP address, or is it NATed and the port forwarded via a router or firewall?

If you're using VirtualBox as a NAT router, any portforwarding will probably have to be performed by VirtualBox, not iptables.
The VM has its own IP.


# netstat -pln | grep 3306
tcp 0 0 xxx.xxx.xxx.xxx:3306 0.0.0.0:* LISTEN 2374/mysqld
 
Old 04-06-2012, 10:02 AM   #6
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Quote:
Originally Posted by snooze1 View Post
The VM has its own IP.
You mean it has a public IP address (bridged networking in VirtualBox), and no NAT is being performed?

If you try connecting to port 3306 from an external host, does tcpdump -i eth0 -v tcp port 3306 on the VM (assuming the public IP is assigned to eth0) show both incoming packets and replies?
 
Old 04-06-2012, 10:31 AM   #7
snooze1
Member
 
Registered: Sep 2011
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
You mean it has a public IP address (bridged networking in VirtualBox), and no NAT is being performed?

If you try connecting to port 3306 from an external host, does tcpdump -i eth0 -v tcp port 3306 on the VM (assuming the public IP is assigned to eth0) show both incoming packets and replies?
It's assigned its own public IP.

I did that command on the VM and tried the MySQL test again, and it's not receiving anything, nothing is happening.

I also tried on the localhost, it connected fine but the packets didn't change.

I made a php script that uses fsockopen and connecting to 3306 TCP from a remote host works.
 
Old 04-06-2012, 10:42 AM   #8
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Quote:
Originally Posted by snooze1 View Post
I did that command on the VM and tried the MySQL test again, and it's not receiving anything, nothing is happening.

I also tried on the localhost, it connected fine but the packets didn't change.

I made a php script that uses fsockopen and connecting to 3306 TCP from a remote host works.
If tcpdump says no packets are received, then connecting to tcp port 3306 does not work. Connecting to localhost will not show in tcpdump, so that's as expected.

If I understand you correctly, the php script caused packets to appear at the VM, while the MySQL test did not. Did you run the php script from a host other than the one from which you're trying to access the MySQL database? If so, I would conclude that the problem might be at the client end of the connection.

Does "telnet <server ip> 3306" from the troublesome client result in packets appearing at the server end? Are you connecting to the server by DNS name, and if so, is name resolution working properly? Could there be firewall issues on the client side?
 
  


Reply



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
Mysql accept remote connections invader7 Linux - Server 9 10-11-2011 04:43 AM
MySQL remote connections from Windows Spetnik Linux - Server 11 09-25-2011 08:45 AM
Allow remote connections MySQL server Skillz Linux - Server 3 06-02-2009 11:34 PM
MySQL + Debian + MySQLCC + Remote Connections, How? Mulsiphix Linux - Newbie 3 01-07-2006 04:46 PM
Restricting XWindows remote connections (iptables) Harpune Linux - Networking 4 02-17-2004 06:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:03 PM.

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