3

My question is rather simple, I have a Windows 7 machine that is hosting an Apache server and a MySQL server using the XAMPP control panel. Both of these have been installed as a service on the machine. I am trying to connect to the MySQL server from a CentOS machine that is on the same LAN. When issuing the command:

mysql -h *IPADD* -u *UNAME* -p*PWORD*

I get this error:

ERROR 2003 (HY000): Can't connect to MySQL server on '172.26.96.166' (110)

I also see no indication in any logs on the Windows machine that there was a connection attempt.

I have spent much time trying to figure out a cause for this and I cannot seem to figure out the issue. I have:

Checked the firewall and explicitly made an exception for mysql

Installed MySQL as a service on the machine

Used the netstat command to verify that the ports are open

Checked and re-checked the username and password being used

Checked the host associated with the used credentials (the host is set to the wild card (%)

After doing all of this, I cant seem to find anything wrong or that would be blocking it. To give some sort of context, I am using this on a medium sized network and my account on the Windows machine is not Admin. However, I have had extensive help from an admin who has been the one authenticating me to change the firewall and what have you. That being said, there still may be restrictions on his account due to some grouping policies or the way the computer is imaged.

It may also be important to note that I am not directly in front of the CentOS machine, I am using "Putty" on the Windows machine to ssh into the machine to issue the MySQL commands

Anything I may have missed or any advice would be much appreciated.

bumped to the homepage by Community 22 hours ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

  • is MySQL installed on default port 3306? if not you may also need to mention -P<port>. It seems MySQL service is not started yet on windows machine you may check the same on services.msc. hope it helps – Nawaz Sohail Mar 27 '15 at 20:14
  • 1
    You can telnet to the mysql on 172.26.96.166 on port 3306 and see what your response is. – Norbert van Nobelen Mar 27 '15 at 20:50
  • Yes indeed mysql is installed on port 3306 and as far as the netstat command shows it is listening on that port. It is listed as running in my services pane as well and I am trying to connect via Putty. So I am using Putty to ssh into the linux machine and trying to send the connection to the server through there. – Darksaint2014 Mar 28 '15 at 15:38
  • What Norbert said ^^. From the Linux machine, telnet 172.26.96.166 3306. You should at least get back a response containing "MySQL". You won't be able to log in, but it's an important step in troubleshooting to verify that the port is accessible to the remote host. – dartonw Mar 28 '15 at 15:55
  • Thank you, I will check on it Tuesday when I have access to the machines again. I will post the results of the Telnet then. – Darksaint2014 Mar 29 '15 at 16:17
0

There are some many potential reasons for this to happen it could literally be almost a hundred different reasons. That said, here are the top ones I'd test first:

  1. Does your connect command work locally?
  2. Can you confirm that port 3306 is open? netstat -plnt | grep 3306
  3. Have you flushed privileges since adding the new user? mysql -uroot -p mysql -e "flush privileges"
  4. Did you grant the new user use permissions? show grants for 'user'@'hostname'
  5. Can your new remote machine connect to port 3306? telnet <server ip> 3306
0

Are you using Putty to log in to DB server or some other server?

If its DB server then, error can be caused by following

  1. Incorrect username/password
  2. Incorrect port number
  3. MySQL DB is not up and running

If you are trying from different host to connect as in remote DB host make sure

  1. you have connectivity between the hosts and
  2. there is no IP based restrictions. As you know admin can restrict access to certain IP address.

Hope this helped.

  • Yes I am in fact using putty, So I am using Putty to ssh into the linux machine and trying to send the connection to the server through there. And I have made sure that I can at least ping the 172 computer through putty so it is listening and not just receiving. – Darksaint2014 Mar 28 '15 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.