error to connect with remote mysql server

Problems with the Windows version of XAMPP, questions, comments, and anything related.

error to connect with remote mysql server

Postby fideria » 27. June 2012 21:45

Hi forum,
I obtein an error when try to connect to the mysql database on server.
I have installed xampp on my server with Windows server operative System.
I have created a .net desktop application based on mysql server.
I installed the application on the server, if I try to connect to the database using host 'localhost' the connection works but if I use the IP address the connection doesn't work.
Obviously I obtein the same error if I install the app in client PC where I need to use IP addres.

How can I configure mysql to works fine?
I hope in your help... please!
fideria
 
Posts: 3
Joined: 27. June 2012 21:27
Operating System: windows server 2003

Re: error to connect with remote mysql server

Postby JonB » 27. June 2012 22:28

You probably needs to assigns a user in MySQL with the correct host rights.

i.e 'joeblow'@'%'

http://dev.mysql.com/doc/refman/5.1/en/ ... names.html

Good Luck
8)




ysf
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: error to connect with remote mysql server

Postby fideria » 28. June 2012 16:32

Hi,
thank you for yor reply!
I have run mysql query
GRANT ALL ON database_name.* TO 'root'@'%'
but I obtain the same error "Can't connect to MySQL server on 'xxx.xx.xx.xx' (10060)

What is my mistake?
What else could I do?

I hope you can help me!!!

Thanks in advance.
fideria
 
Posts: 3
Joined: 27. June 2012 21:27
Operating System: windows server 2003

Re: error to connect with remote mysql server

Postby JonB » 28. June 2012 18:16

"Can't connect to MySQL server on 'xxx.xx.xx.xx' (10060)

That isn't directly a XAMPP or MySQL error - its a Windows OS error -

http://msdn.microsoft.com/en-us/library ... 68(v=vs.85).aspx

It usually means that you can't reach the host (routing or firewall). That problem can be on either end.

Google on 'Can't connect to MySQL server on 'xxx.xx.xx.xx' (10060)'

you will find dozens of issues and the potential solutions.

Did you set a password for root?

This is NOT about your current problem, just an observation:
From a security point of view, its not usually best to make 'root' an active database user. Altrea gave a good explanation of how to work with users and databases in this topic:\
viewtopic.php?f=16&t=50867

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: error to connect with remote mysql server

Postby fideria » 29. June 2012 11:21

Hi,
I have changed the config of file xampp\apache\conf\extra\httpd-xampp.conf
I have added the line "Allow from all"

#
# New XAMPP security concept
#

# Close XAMPP security section here
<LocationMatch "^/(?i:(?:security))">
Order deny,allow
Deny from all
Allow from ::1 127.0.0.0/8
Allow from all
ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>

# Close XAMPP sites here
<LocationMatch "^/(?i:(?:xampp|licenses|phpmyadmin|webalizer|server-status|server-info))">
Order deny,allow
Deny from all
Allow from ::1 127.0.0.0/8
Allow from all
ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>

Now, I can access to database mysql from pc on lan, but if I try to connect by remote pc this doesn't work.
Why? :-(
fideria
 
Posts: 3
Joined: 27. June 2012 21:27
Operating System: windows server 2003

Re: error to connect with remote mysql server

Postby JonB » 29. June 2012 14:16

The last changes you made have nothing to do with MySQL, they only affect URL's within your site. 'Allow from all' effectively opens your system to any IP that can tunnel into your network.

Here's a complete breakdown of how that works:
http://bravo.newnetenterprises.com/word ... -security/

I have pointed out to you the MySQL problem from Remote PC's.

If you are still getting the "Can't connect to MySQL server on 'xxx.xx.xx.xx' (10060)" error, you have not solved your MySQL issue. When you get an error message on the Windows platform that has an external error code, its a sign the problem is NOT the application/service itself, but an underlying problem at the Operating System level.

Did you forward port 3306 on your router/firewall?

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 138 guests